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