Commit b61baa9e authored by neis's avatar neis Committed by Commit bot

[builtins] Remove template argument from args.target().

It's always JSFunction.

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2422573002
Cr-Commit-Position: refs/heads/master@{#40301}
parent c592e454
......@@ -122,7 +122,7 @@ MUST_USE_RESULT MaybeHandle<Object> HandleApiCallHelper(
BUILTIN(HandleApiCall) {
HandleScope scope(isolate);
Handle<JSFunction> function = args.target<JSFunction>();
Handle<JSFunction> function = args.target();
Handle<Object> receiver = args.receiver();
Handle<HeapObject> new_target = args.new_target();
Handle<FunctionTemplateInfo> fun_data(function->shared()->get_api_func_data(),
......
......@@ -14,7 +14,7 @@ namespace internal {
// ES6 section 24.1.2.1 ArrayBuffer ( length ) for the [[Call]] case.
BUILTIN(ArrayBufferConstructor) {
HandleScope scope(isolate);
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
DCHECK(*target == target->native_context()->array_buffer_fun() ||
*target == target->native_context()->shared_array_buffer_fun());
THROW_NEW_ERROR_RETURN_FAILURE(
......@@ -25,7 +25,7 @@ BUILTIN(ArrayBufferConstructor) {
// ES6 section 24.1.2.1 ArrayBuffer ( length ) for the [[Construct]] case.
BUILTIN(ArrayBufferConstructor_ConstructStub) {
HandleScope scope(isolate);
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
Handle<Object> length = args.atOrUndefined(isolate, 1);
DCHECK(*target == target->native_context()->array_buffer_fun() ||
......
......@@ -22,7 +22,7 @@ BUILTIN(BooleanConstructor) {
BUILTIN(BooleanConstructor_ConstructStub) {
HandleScope scope(isolate);
Handle<Object> value = args.atOrUndefined(isolate, 1);
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
DCHECK(*target == target->native_context()->boolean_function());
Handle<JSObject> result;
......
......@@ -23,7 +23,7 @@ BUILTIN(DataViewConstructor) {
// ES6 section 24.2.2 The DataView Constructor for the [[Construct]] case.
BUILTIN(DataViewConstructor_ConstructStub) {
HandleScope scope(isolate);
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
Handle<Object> buffer = args.atOrUndefined(isolate, 1);
Handle<Object> byte_offset = args.atOrUndefined(isolate, 2);
......
......@@ -203,7 +203,7 @@ BUILTIN(DateConstructor) {
BUILTIN(DateConstructor_ConstructStub) {
HandleScope scope(isolate);
int const argc = args.length() - 1;
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSReceiver> new_target = Handle<JSReceiver>::cast(args.new_target());
double time_val;
if (argc == 0) {
......
......@@ -28,7 +28,7 @@ BUILTIN(ErrorConstructor) {
}
RETURN_RESULT_OR_FAILURE(
isolate, ErrorUtils::Construct(isolate, args.target<JSFunction>(),
isolate, ErrorUtils::Construct(isolate, args.target(),
Handle<Object>::cast(args.new_target()),
args.atOrUndefined(isolate, 1), mode,
caller, false));
......
......@@ -21,7 +21,7 @@ MaybeHandle<Object> CreateDynamicFunction(Isolate* isolate,
DCHECK_LE(1, args.length());
int const argc = args.length() - 1;
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSObject> target_global_proxy(target->global_proxy(), isolate);
if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) {
......
......@@ -83,7 +83,7 @@ BUILTIN(GlobalUnescape) {
BUILTIN(GlobalEval) {
HandleScope scope(isolate);
Handle<Object> x = args.atOrUndefined(isolate, 1);
Handle<JSFunction> target = args.target<JSFunction>();
Handle<JSFunction> target = args.target();
Handle<JSObject> target_global_proxy(target->global_proxy(), isolate);
if (!x->IsString()) return *x;
if (!Builtins::AllowDynamicFunction(isolate, target, target_global_proxy)) {
......
......@@ -41,7 +41,7 @@ BUILTIN(FixedArrayIteratorNext) {
// particular iterator object for which the function was created.
if (!receiver->IsJSFixedArrayIterator() ||
Handle<JSFixedArrayIterator>::cast(receiver)->initial_next() !=
*args.target<JSFunction>()) {
*args.target()) {
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kIncompatibleMethodReceiver,
isolate->factory()->next_string(), receiver));
......
......@@ -48,9 +48,8 @@ class BuiltinArguments : public Arguments {
static const int kNumExtraArgs = 3;
static const int kNumExtraArgsWithReceiver = 4;
template <class S>
Handle<S> target() {
return Arguments::at<S>(Arguments::length() - 1 - kTargetOffset);
Handle<JSFunction> target() {
return Arguments::at<JSFunction>(Arguments::length() - 1 - kTargetOffset);
}
Handle<HeapObject> new_target() {
return Arguments::at<HeapObject>(Arguments::length() - 1 -
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment