Commit 4eebf032 authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

Add missing CSA routines in preparation for Torque

Change-Id: I170f47ee1c1e7e1a1296d5e5fc7fd1e2ab28a2f7
Reviewed-on: https://chromium-review.googlesource.com/1005076
Commit-Queue: Daniel Clifford <danno@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#52521}
parent b4cf6298
......@@ -167,6 +167,13 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
return UncheckedCast<JSArray>(value);
}
TNode<HeapObject> TaggedToCallable(TNode<Object> value, Label* fail) {
GotoIf(TaggedIsSmi(value), fail);
TNode<HeapObject> result = UncheckedCast<HeapObject>(value);
GotoIfNot(IsCallableMap(LoadMap(result)), fail);
return result;
}
Node* MatchesParameterMode(Node* value, ParameterMode mode);
#define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \
......@@ -370,6 +377,23 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
Node* extra_node4 = nullptr, const char* extra_node4_name = "",
Node* extra_node5 = nullptr, const char* extra_node5_name = "");
// The following Call wrappers call an object according to the semantics that
// one finds in the EcmaScript spec, operating on an Callable (e.g. a
// JSFunction or proxy) rather than a Code object.
template <class... TArgs>
TNode<Object> Call(TNode<Context> context, TNode<Object> callable,
TNode<JSReceiver> receiver, TArgs... args) {
return UncheckedCast<Object>(CallJS(
CodeFactory::Call(isolate(), ConvertReceiverMode::kNotNullOrUndefined),
context, callable, receiver, args...));
}
template <class... TArgs>
TNode<Object> Call(TNode<Context> context, TNode<Object> callable,
TNode<Object> receiver, TArgs... args) {
return UncheckedCast<Object>(CallJS(CodeFactory::Call(isolate()), context,
callable, receiver, args...));
}
template <class A, class F, class G>
TNode<A> Select(SloppyTNode<BoolT> condition, const F& true_body,
const G& false_body) {
......
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