Commit 831bce26 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[cleanup] Remove Sloppy-ness in call methods in code-assembler

Bug: v8:6949, v8:10155
Change-Id: I5f5b78cb57776d1022f206f09242768b3dd8d9e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2056848Reviewed-by: 's avatarDan Elphick <delphick@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66283}
parent dcb3c178
...@@ -950,15 +950,15 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -950,15 +950,15 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// Calls // Calls
template <class... TArgs> template <class... TArgs>
TNode<Object> CallRuntime(Runtime::FunctionId function, TNode<Object> CallRuntime(Runtime::FunctionId function, TNode<Object> context,
SloppyTNode<Object> context, TArgs... args) { TArgs... args) {
return CallRuntimeImpl(function, context, return CallRuntimeImpl(function, context,
{implicit_cast<TNode<Object>>(args)...}); {implicit_cast<TNode<Object>>(args)...});
} }
template <class... TArgs> template <class... TArgs>
void TailCallRuntime(Runtime::FunctionId function, void TailCallRuntime(Runtime::FunctionId function, TNode<Object> context,
SloppyTNode<Object> context, TArgs... args) { 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 TailCallRuntimeImpl(function, arity, context, return TailCallRuntimeImpl(function, arity, context,
...@@ -967,7 +967,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -967,7 +967,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
template <class... TArgs> template <class... TArgs>
void TailCallRuntime(Runtime::FunctionId function, TNode<Int32T> arity, void TailCallRuntime(Runtime::FunctionId function, TNode<Int32T> arity,
SloppyTNode<Object> context, TArgs... args) { TNode<Object> context, TArgs... args) {
return TailCallRuntimeImpl(function, arity, context, return TailCallRuntimeImpl(function, arity, context,
{implicit_cast<TNode<Object>>(args)...}); {implicit_cast<TNode<Object>>(args)...});
} }
...@@ -977,7 +977,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -977,7 +977,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
// //
template <class T = Object, class... TArgs> template <class T = Object, class... TArgs>
TNode<T> CallStub(Callable const& callable, SloppyTNode<Object> context, TNode<T> CallStub(Callable const& callable, TNode<Object> context,
TArgs... args) { TArgs... args) {
TNode<Code> target = HeapConstant(callable.code()); TNode<Code> target = HeapConstant(callable.code());
return CallStub<T>(callable.descriptor(), target, context, args...); return CallStub<T>(callable.descriptor(), target, context, args...);
...@@ -985,8 +985,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -985,8 +985,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
template <class T = Object, class... TArgs> template <class T = Object, class... TArgs>
TNode<T> CallStub(const CallInterfaceDescriptor& descriptor, TNode<T> CallStub(const CallInterfaceDescriptor& descriptor,
SloppyTNode<Code> target, SloppyTNode<Object> context, TNode<Code> target, TNode<Object> context, TArgs... args) {
TArgs... args) {
return UncheckedCast<T>(CallStubR(StubCallMode::kCallCodeObject, descriptor, return UncheckedCast<T>(CallStubR(StubCallMode::kCallCodeObject, descriptor,
1, target, context, args...)); 1, target, context, args...));
} }
...@@ -994,8 +993,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -994,8 +993,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
template <class... TArgs> template <class... TArgs>
Node* CallStubR(StubCallMode call_mode, Node* CallStubR(StubCallMode call_mode,
const CallInterfaceDescriptor& descriptor, size_t result_size, const CallInterfaceDescriptor& descriptor, size_t result_size,
SloppyTNode<Object> target, SloppyTNode<Object> context, TNode<Object> target, TNode<Object> context, TArgs... args) {
TArgs... args) {
return CallStubRImpl(call_mode, descriptor, result_size, target, context, return CallStubRImpl(call_mode, descriptor, result_size, target, context,
{args...}); {args...});
} }
...@@ -1013,7 +1011,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -1013,7 +1011,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
} }
template <class... TArgs> template <class... TArgs>
void TailCallStub(Callable const& callable, SloppyTNode<Object> context, void TailCallStub(Callable const& callable, TNode<Object> context,
TArgs... args) { TArgs... args) {
TNode<Code> target = HeapConstant(callable.code()); TNode<Code> target = HeapConstant(callable.code());
TailCallStub(callable.descriptor(), target, context, args...); TailCallStub(callable.descriptor(), target, context, args...);
...@@ -1021,8 +1019,7 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -1021,8 +1019,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
template <class... TArgs> template <class... TArgs>
void TailCallStub(const CallInterfaceDescriptor& descriptor, void TailCallStub(const CallInterfaceDescriptor& descriptor,
SloppyTNode<Code> target, SloppyTNode<Object> context, TNode<Code> target, TNode<Object> context, TArgs... args) {
TArgs... args) {
TailCallStubImpl(descriptor, target, context, {args...}); TailCallStubImpl(descriptor, target, context, {args...});
} }
...@@ -1054,7 +1051,8 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -1054,7 +1051,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
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, CAST(context), function, arity, receiver,
args...);
} }
template <class... TArgs> template <class... TArgs>
...@@ -1065,8 +1063,8 @@ class V8_EXPORT_PRIVATE CodeAssembler { ...@@ -1065,8 +1063,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
TNode<Object> receiver = LoadRoot(RootIndex::kUndefinedValue); TNode<Object> receiver = LoadRoot(RootIndex::kUndefinedValue);
// Construct(target, new_target, arity, receiver, arguments...) // Construct(target, new_target, arity, receiver, arguments...)
return CallStub(callable, context, target, new_target, arity, receiver, return CallStub(callable, CAST(context), target, new_target, arity,
args...); receiver, args...);
} }
template <class... TArgs> template <class... TArgs>
Node* ConstructJS(Callable const& callable, Node* context, Node* new_target, Node* ConstructJS(Callable const& callable, Node* context, Node* new_target,
......
...@@ -3624,7 +3624,7 @@ TEST(TestCallBuiltinInlineTrampoline) { ...@@ -3624,7 +3624,7 @@ TEST(TestCallBuiltinInlineTrampoline) {
const int kContextOffset = 2; const int kContextOffset = 2;
Node* str = m.Parameter(0); Node* str = m.Parameter(0);
Node* context = m.Parameter(kNumParams + kContextOffset); TNode<Context> context = m.CAST(m.Parameter(kNumParams + kContextOffset));
TNode<Smi> index = m.SmiConstant(2); TNode<Smi> index = m.SmiConstant(2);
...@@ -3650,7 +3650,7 @@ DISABLED_TEST(TestCallBuiltinIndirectLoad) { ...@@ -3650,7 +3650,7 @@ DISABLED_TEST(TestCallBuiltinIndirectLoad) {
const int kContextOffset = 2; const int kContextOffset = 2;
Node* str = m.Parameter(0); Node* str = m.Parameter(0);
Node* context = m.Parameter(kNumParams + kContextOffset); TNode<Context> context = m.CAST(m.Parameter(kNumParams + kContextOffset));
TNode<Smi> index = m.SmiConstant(2); TNode<Smi> index = m.SmiConstant(2);
......
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