[cleanup] Remove is_null from tnode.h
Instead of checking for the null TNode, we can use base::Optional. Bug: v8:6949 Change-Id: I550b2fdb507c61ea6128a0631351b22a8542d4d3 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2737296 Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org> Reviewed-by: Dan Elphick <delphick@chromium.org> Cr-Commit-Position: refs/heads/master@{#73260}
This commit is contained in:
parent
f95db8916a
commit
b1c5a9a26f
@ -347,8 +347,6 @@ class TNode {
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool is_null() const { return node_ == nullptr; }
|
||||
|
||||
operator compiler::Node*() const { return node_; }
|
||||
|
||||
static TNode UncheckedCast(compiler::Node* node) { return TNode(node); }
|
||||
|
@ -1088,7 +1088,7 @@ Node* CodeAssembler::CallStubRImpl(StubCallMode call_mode,
|
||||
Node* CodeAssembler::CallJSStubImpl(const CallInterfaceDescriptor& descriptor,
|
||||
TNode<Object> target, TNode<Object> context,
|
||||
TNode<Object> function,
|
||||
TNode<Object> new_target,
|
||||
base::Optional<TNode<Object>> new_target,
|
||||
TNode<Int32T> arity,
|
||||
std::initializer_list<Node*> args) {
|
||||
constexpr size_t kMaxNumArgs = 10;
|
||||
@ -1096,8 +1096,8 @@ Node* CodeAssembler::CallJSStubImpl(const CallInterfaceDescriptor& descriptor,
|
||||
NodeArray<kMaxNumArgs + 5> inputs;
|
||||
inputs.Add(target);
|
||||
inputs.Add(function);
|
||||
if (!new_target.is_null()) {
|
||||
inputs.Add(new_target);
|
||||
if (new_target) {
|
||||
inputs.Add(*new_target);
|
||||
}
|
||||
inputs.Add(arity);
|
||||
for (auto arg : args) inputs.Add(arg);
|
||||
|
@ -14,6 +14,7 @@
|
||||
// Do not include anything from src/compiler here!
|
||||
#include "include/cppgc/source-location.h"
|
||||
#include "src/base/macros.h"
|
||||
#include "src/base/optional.h"
|
||||
#include "src/base/type-traits.h"
|
||||
#include "src/builtins/builtins.h"
|
||||
#include "src/codegen/code-factory.h"
|
||||
@ -1136,8 +1137,7 @@ class V8_EXPORT_PRIVATE CodeAssembler {
|
||||
TNode<Int32T> arity = Int32Constant(argc);
|
||||
TNode<Code> target = HeapConstant(callable.code());
|
||||
return CAST(CallJSStubImpl(callable.descriptor(), target, CAST(context),
|
||||
CAST(function), TNode<Object>(), arity,
|
||||
{receiver, args...}));
|
||||
CAST(function), {}, arity, {receiver, args...}));
|
||||
}
|
||||
|
||||
template <class... TArgs>
|
||||
@ -1267,7 +1267,8 @@ class V8_EXPORT_PRIVATE CodeAssembler {
|
||||
|
||||
Node* CallJSStubImpl(const CallInterfaceDescriptor& descriptor,
|
||||
TNode<Object> target, TNode<Object> context,
|
||||
TNode<Object> function, TNode<Object> new_target,
|
||||
TNode<Object> function,
|
||||
base::Optional<TNode<Object>> new_target,
|
||||
TNode<Int32T> arity, std::initializer_list<Node*> args);
|
||||
|
||||
Node* CallStubN(StubCallMode call_mode,
|
||||
|
@ -1479,12 +1479,12 @@ struct MapFrameStateParams {
|
||||
TNode<Object> receiver;
|
||||
TNode<Object> callback;
|
||||
TNode<Object> this_arg;
|
||||
TNode<JSArray> a;
|
||||
base::Optional<TNode<JSArray>> a;
|
||||
TNode<Object> original_length;
|
||||
};
|
||||
|
||||
FrameState MapPreLoopLazyFrameState(const MapFrameStateParams& params) {
|
||||
DCHECK(params.a.is_null());
|
||||
DCHECK(!params.a);
|
||||
Node* checkpoint_params[] = {params.receiver, params.callback,
|
||||
params.this_arg, params.original_length};
|
||||
return CreateJavaScriptBuiltinContinuationFrameState(
|
||||
@ -1497,7 +1497,7 @@ FrameState MapPreLoopLazyFrameState(const MapFrameStateParams& params) {
|
||||
FrameState MapLoopLazyFrameState(const MapFrameStateParams& params,
|
||||
TNode<Number> k) {
|
||||
Node* checkpoint_params[] = {
|
||||
params.receiver, params.callback, params.this_arg, params.a, k,
|
||||
params.receiver, params.callback, params.this_arg, *params.a, k,
|
||||
params.original_length};
|
||||
return CreateJavaScriptBuiltinContinuationFrameState(
|
||||
params.jsgraph, params.shared,
|
||||
@ -1509,7 +1509,7 @@ FrameState MapLoopLazyFrameState(const MapFrameStateParams& params,
|
||||
FrameState MapLoopEagerFrameState(const MapFrameStateParams& params,
|
||||
TNode<Number> k) {
|
||||
Node* checkpoint_params[] = {
|
||||
params.receiver, params.callback, params.this_arg, params.a, k,
|
||||
params.receiver, params.callback, params.this_arg, *params.a, k,
|
||||
params.original_length};
|
||||
return CreateJavaScriptBuiltinContinuationFrameState(
|
||||
params.jsgraph, params.shared,
|
||||
|
Loading…
Reference in New Issue
Block a user