Commit 6a2926e5 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Add CSA types to CallBuiltin and GetMethod.

Bug: v8:7310
Change-Id: Iaebe8fa8e5a622b0963754548aa7e29fd6028e22
Reviewed-on: https://chromium-review.googlesource.com/934203Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51501}
parent fd8c3cde
......@@ -2140,7 +2140,7 @@ TF_BUILTIN(ArrayFrom, ArrayPopulatorAssembler) {
BIND(&loop);
TVARIABLE(Object, value);
value = CAST(GetProperty(context, array_like, index.value()));
value = GetProperty(context, array_like, index.value());
// If a map_function is supplied then call it (using this_arg as
// receiver), on the value retrieved from the array.
......
......@@ -382,8 +382,7 @@ TNode<Object> BaseCollectionsAssembler::GetAddFunction(
Handle<String> add_func_name = (variant == kMap || variant == kWeakMap)
? isolate()->factory()->set_string()
: isolate()->factory()->add_string();
TNode<Object> add_func =
CAST(GetProperty(context, collection, add_func_name));
TNode<Object> add_func = GetProperty(context, collection, add_func_name);
Label exit(this), if_notcallable(this, Label::kDeferred);
GotoIf(TaggedIsSmi(add_func), &if_notcallable);
......@@ -1186,9 +1185,9 @@ std::tuple<Node*, Node*> CollectionsBuiltinsAssembler::Transition(
GotoIf(TaggedIsSmi(next_table), &done_loop);
var_table.Bind(next_table);
var_index.Bind(
SmiUntag(CallBuiltin(Builtins::kOrderedHashTableHealIndex,
NoContextConstant(), table, SmiTag(index))));
var_index.Bind(SmiUntag(
CAST(CallBuiltin(Builtins::kOrderedHashTableHealIndex,
NoContextConstant(), table, SmiTag(index)))));
Goto(&loop);
}
BIND(&done_loop);
......
......@@ -394,7 +394,7 @@ TF_BUILTIN(ObjectPrototypeToLocaleString, CodeStubAssembler) {
GotoIf(IsNullOrUndefined(receiver), &if_null_or_undefined);
TNode<Object> method =
CAST(GetProperty(context, receiver, factory()->toString_string()));
GetProperty(context, receiver, factory()->toString_string());
Return(CallJS(CodeFactory::Call(isolate()), context, method, receiver));
BIND(&if_null_or_undefined);
......
......@@ -506,8 +506,8 @@ void TypedArrayBuiltinsAssembler::ConstructByTypedArray(
{
ConstructByArrayLike(context, holder, typed_array, source_length.value(),
element_size);
Node* proto = GetProperty(context, buffer_constructor.value(),
PrototypeStringConstant());
TNode<Object> proto = GetProperty(context, buffer_constructor.value(),
PrototypeStringConstant());
// TODO(petermarshall): Correct for realm as per 9.1.14 step 4.
TNode<JSArrayBuffer> buffer = LoadObjectField<JSArrayBuffer>(
holder, JSArrayBufferView::kBufferOffset);
......@@ -693,7 +693,7 @@ TF_BUILTIN(TypedArrayConstructor_ConstructStub, TypedArrayBuiltinsAssembler) {
{
TNode<HeapObject> array_like = CAST(arg1);
TNode<Object> initial_length =
CAST(GetProperty(context, arg1, LengthStringConstant()));
GetProperty(context, arg1, LengthStringConstant());
ConstructByArrayLike(context, holder, array_like, initial_length,
element_size);
......@@ -1734,8 +1734,8 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
final_source = CAST(source);
// 10. Let len be ? ToLength(? Get(arrayLike, "length")).
TNode<Object> raw_length = CAST(
GetProperty(context, final_source.value(), LengthStringConstant()));
TNode<Object> raw_length =
GetProperty(context, final_source.value(), LengthStringConstant());
final_length = ToSmiLength(raw_length, context, &if_length_not_smi);
Goto(&create_typed_array);
......@@ -1777,7 +1777,7 @@ TF_BUILTIN(TypedArrayFrom, TypedArrayBuiltinsAssembler) {
SmiConstant(0), final_length.value(),
[&](Node* index) {
TNode<Object> const k_value =
CAST(GetProperty(context, final_source.value(), index));
GetProperty(context, final_source.value(), index);
TNode<Object> const mapped_value =
CAST(CallJS(CodeFactory::Call(isolate()), context, map_fn, this_arg,
......
......@@ -5809,12 +5809,13 @@ TNode<Number> CodeStubAssembler::ToNumber_Inline(SloppyTNode<Context> context,
BIND(&not_smi);
{
var_result = Select<Number>(
IsHeapNumber(input), [=] { return CAST(input); },
[=] {
return CallBuiltin(Builtins::kNonNumberToNumber, context, input);
},
MachineRepresentation::kTagged);
var_result =
Select<Number>(IsHeapNumber(input), [=] { return CAST(input); },
[=] {
return CAST(CallBuiltin(Builtins::kNonNumberToNumber,
context, input));
},
MachineRepresentation::kTagged);
Goto(&end);
}
......
......@@ -1680,30 +1680,37 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
}
#endif // V8_EMBEDDED_BUILTINS
Node* GetProperty(Node* context, Node* receiver, Handle<Name> name) {
TNode<Object> GetProperty(SloppyTNode<Context> context,
SloppyTNode<Object> receiver, Handle<Name> name) {
return GetProperty(context, receiver, HeapConstant(name));
}
Node* GetProperty(Node* context, Node* receiver, Node* const name) {
return CallStub(CodeFactory::GetProperty(isolate()), context, receiver,
name);
TNode<Object> GetProperty(SloppyTNode<Context> context,
SloppyTNode<Object> receiver,
SloppyTNode<Object> name) {
return UncheckedCast<Object>(
CallStub(CodeFactory::GetProperty(isolate()), context, receiver, name));
}
Node* GetMethod(Node* context, Node* object, Handle<Name> name,
Label* if_null_or_undefined);
template <class... TArgs>
Node* CallBuiltin(Builtins::Name id, Node* context, TArgs... args) {
TNode<Object> CallBuiltin(Builtins::Name id, SloppyTNode<Context> context,
TArgs... args) {
DCHECK_IMPLIES(Builtins::KindOf(id) == Builtins::TFJ,
!Builtins::IsLazy(id));
return CallStub(Builtins::CallableFor(isolate(), id), context, args...);
return UncheckedCast<Object>(
CallStub(Builtins::CallableFor(isolate(), id), context, args...));
}
template <class... TArgs>
Node* TailCallBuiltin(Builtins::Name id, Node* context, TArgs... args) {
TNode<Object> TailCallBuiltin(Builtins::Name id, SloppyTNode<Context> context,
TArgs... args) {
DCHECK_IMPLIES(Builtins::KindOf(id) == Builtins::TFJ,
!Builtins::IsLazy(id));
return TailCallStub(Builtins::CallableFor(isolate(), id), context, args...);
return UncheckedCast<Object>(
TailCallStub(Builtins::CallableFor(isolate(), id), context, args...));
}
void LoadPropertyFromFastObject(Node* object, Node* map, Node* descriptors,
......
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