Commit 364bcdf2 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

[csa] Make CallJS return TNode<Object>

Bug: v8:6949
Change-Id: I7f41d72a4726cff0e61ff9cbe3fc3f18930f0da1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1852128
Auto-Submit: Dan Elphick <delphick@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64216}
parent d53eddb5
......@@ -51,8 +51,8 @@ TNode<Object> ArrayBuiltinsAssembler::TypedArrayMapProcessor(
TNode<Object> k_value, TNode<Object> k) {
// 8. c. Let mapped_value be ? Call(callbackfn, T, « kValue, k, O »).
TNode<Object> mapped_value =
CAST(CallJS(CodeFactory::Call(isolate()), context(), callbackfn(),
this_arg(), k_value, k, o()));
CallJS(CodeFactory::Call(isolate()), context(), callbackfn(), this_arg(),
k_value, k, o());
Label fast(this), slow(this), done(this), detached(this, Label::kDeferred);
// 8. d. Perform ? Set(A, Pk, mapped_value, true).
......@@ -735,8 +735,8 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
GotoIf(IsUndefined(map_function), &next);
CSA_ASSERT(this, IsCallable(CAST(map_function)));
value = CAST(CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, value.value(), index.value()));
value = CallJS(CodeFactory::Call(isolate()), context, map_function,
this_arg, value.value(), index.value());
Goto(&next);
BIND(&next);
}
......@@ -1660,9 +1660,9 @@ class ArrayFlattenAssembler : public CodeStubAssembler {
// 1. Set element to ? Call(mapperFunction, thisArg , « element,
// sourceIndex, source »).
element_maybe_smi = CAST(CallJS(
CodeFactory::Call(isolate()), context, mapper_function.value(),
this_arg.value(), element_maybe_smi, source_index, source));
element_maybe_smi = CallJS(CodeFactory::Call(isolate()), context,
mapper_function.value(), this_arg.value(),
element_maybe_smi, source_index, source);
}
// iii. Let shouldFlatten be false.
......
......@@ -44,7 +44,7 @@ void ConversionBuiltinsAssembler::Generate_NonPrimitiveToPrimitive(
TNode<String> hint_string =
HeapConstant(factory()->ToPrimitiveHintString(hint));
TNode<Object> result =
CAST(CallJS(callable, context, exotic_to_prim, input, hint_string));
CallJS(callable, context, exotic_to_prim, input, hint_string);
// Verify that the {result} is actually a primitive.
Label if_resultisprimitive(this),
......@@ -250,7 +250,7 @@ void ConversionBuiltinsAssembler::Generate_OrdinaryToPrimitive(
// Call the {method} on the {input}.
Callable callable = CodeFactory::Call(
isolate(), ConvertReceiverMode::kNotNullOrUndefined);
TNode<Object> result = CAST(CallJS(callable, context, method, input));
TNode<Object> result = CallJS(callable, context, method, input);
var_result = result;
// Return the {result} if it is a primitive.
......
......@@ -1569,8 +1569,7 @@ TNode<Object> RegExpBuiltinsAssembler::RegExpExec(
BIND(&if_iscallable);
{
Callable call_callable = CodeFactory::Call(isolate());
var_result =
CAST(CallJS(call_callable, context, exec, maybe_regexp, string));
var_result = CallJS(call_callable, context, exec, maybe_regexp, string);
GotoIf(IsNull(var_result.value()), &out);
......
......@@ -1024,8 +1024,8 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
GetProperty(context, final_source.value(), index);
TNode<Object> const mapped_value =
CAST(CallJS(CodeFactory::Call(isolate()), context, map_fn, this_arg,
k_value, index));
CallJS(CodeFactory::Call(isolate()), context, map_fn, this_arg,
k_value, index);
DispatchTypedArrayByElementsKind(
elements_kind,
......
......@@ -1063,7 +1063,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<Int32T> arg_count);
template <class... TArgs>
Node* CallJS(Callable const& callable, Node* context, Node* function,
TNode<Object> CallJS(Callable const& callable, Node* context, Node* function,
Node* receiver, TArgs... args) {
int argc = static_cast<int>(sizeof...(args));
TNode<Int32T> arity = Int32Constant(argc);
......
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