Commit 1a1a3cc4 authored by petermarshall's avatar petermarshall Committed by Commit bot

[turbo] Rename CallConstruct* operators to Construct*.

Review-Url: https://codereview.chromium.org/2662263002
Cr-Commit-Position: refs/heads/master@{#42836}
parent f33cd98c
......@@ -1861,7 +1861,7 @@ void AstGraphBuilder::VisitCallNew(CallNew* expr) {
float const frequency = ComputeCallFrequency(expr->CallNewFeedbackSlot());
VectorSlotPair feedback = CreateVectorSlotPair(expr->CallNewFeedbackSlot());
const Operator* call =
javascript()->CallConstruct(args->length() + 2, frequency, feedback);
javascript()->Construct(args->length() + 2, frequency, feedback);
Node* value = ProcessArguments(call, args->length() + 2);
PrepareFrameState(value, expr->ReturnId(), OutputFrameStateCombine::Push());
ast_context()->ProduceValue(expr, value);
......
......@@ -248,7 +248,7 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
// Named and keyed loads require a VectorSlotPair for successful lowering.
VectorSlotPair CreateVectorSlotPair(FeedbackVectorSlot slot) const;
// Computes the frequency for JSCallFunction and JSCallConstruct nodes.
// Computes the frequency for JSCallFunction and JSConstruct nodes.
float ComputeCallFrequency(FeedbackVectorSlot slot) const;
// ===========================================================================
......
......@@ -1377,7 +1377,7 @@ void BytecodeGraphBuilder::VisitNewWithSpread() {
Node* callee = environment()->LookupRegister(callee_reg);
const Operator* op =
javascript()->CallConstructWithSpread(static_cast<int>(arg_count) + 2);
javascript()->ConstructWithSpread(static_cast<int>(arg_count) + 2);
Node* value = ProcessCallNewWithSpreadArguments(op, callee, new_target,
first_arg, arg_count + 2);
environment()->BindAccumulator(value, Environment::kAttachFrameState);
......@@ -1426,7 +1426,7 @@ void BytecodeGraphBuilder::VisitNew() {
Node* callee = environment()->LookupRegister(callee_reg);
float const frequency = ComputeCallFrequency(slot_id);
const Operator* call = javascript()->CallConstruct(
const Operator* call = javascript()->Construct(
static_cast<int>(arg_count) + 2, frequency, feedback);
Node* value = ProcessCallNewArguments(call, callee, new_target, first_arg,
arg_count + 2);
......
......@@ -20,10 +20,10 @@ namespace compiler {
Reduction JSCallReducer::Reduce(Node* node) {
switch (node->opcode()) {
case IrOpcode::kJSCallConstruct:
return ReduceJSCallConstruct(node);
case IrOpcode::kJSCallConstructWithSpread:
return ReduceJSCallConstructWithSpread(node);
case IrOpcode::kJSConstruct:
return ReduceJSConstruct(node);
case IrOpcode::kJSConstructWithSpread:
return ReduceJSConstructWithSpread(node);
case IrOpcode::kJSCallFunction:
return ReduceJSCallFunction(node);
default:
......@@ -578,10 +578,9 @@ Reduction JSCallReducer::ReduceJSCallFunction(Node* node) {
return NoChange();
}
Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
DCHECK_EQ(IrOpcode::kJSCallConstruct, node->opcode());
CallConstructParameters const& p = CallConstructParametersOf(node->op());
Reduction JSCallReducer::ReduceJSConstruct(Node* node) {
DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode());
ConstructParameters const& p = ConstructParametersOf(node->op());
DCHECK_LE(2u, p.arity());
int const arity = static_cast<int>(p.arity() - 2);
Node* target = NodeProperties::GetValueInput(node, 0);
......@@ -589,7 +588,7 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
// Try to specialize JSCallConstruct {node}s with constant {target}s.
// Try to specialize JSConstruct {node}s with constant {target}s.
HeapObjectMatcher m(target);
if (m.HasValue()) {
if (m.Value()->IsJSFunction()) {
......@@ -678,15 +677,15 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
effect =
graph()->NewNode(simplified()->CheckIf(), check, effect, control);
// Specialize the JSCallConstruct node to the {target_function}.
// Specialize the JSConstruct node to the {target_function}.
NodeProperties::ReplaceValueInput(node, target_function, 0);
NodeProperties::ReplaceEffectInput(node, effect);
if (target == new_target) {
NodeProperties::ReplaceValueInput(node, target_function, arity + 1);
}
// Try to further reduce the JSCallConstruct {node}.
Reduction const reduction = ReduceJSCallConstruct(node);
// Try to further reduce the JSConstruct {node}.
Reduction const reduction = ReduceJSConstruct(node);
return reduction.Changed() ? reduction : Changed(node);
}
}
......@@ -694,10 +693,10 @@ Reduction JSCallReducer::ReduceJSCallConstruct(Node* node) {
return NoChange();
}
Reduction JSCallReducer::ReduceJSCallConstructWithSpread(Node* node) {
DCHECK_EQ(IrOpcode::kJSCallConstructWithSpread, node->opcode());
CallConstructWithSpreadParameters const& p =
CallConstructWithSpreadParametersOf(node->op());
Reduction JSCallReducer::ReduceJSConstructWithSpread(Node* node) {
DCHECK_EQ(IrOpcode::kJSConstructWithSpread, node->opcode());
ConstructWithSpreadParameters const& p =
ConstructWithSpreadParametersOf(node->op());
DCHECK_LE(3u, p.arity());
int arity = static_cast<int>(p.arity() - 2);
......@@ -762,7 +761,7 @@ Reduction JSCallReducer::ReduceJSCallConstructWithSpread(Node* node) {
}
NodeProperties::ChangeOp(
node, javascript()->CallConstruct(arity + 2, 7, VectorSlotPair()));
node, javascript()->Construct(arity + 2, 7, VectorSlotPair()));
return Changed(node);
}
......
......@@ -23,7 +23,7 @@ class JSGraph;
class JSOperatorBuilder;
class SimplifiedOperatorBuilder;
// Performs strength reduction on {JSCallConstruct} and {JSCallFunction} nodes,
// Performs strength reduction on {JSConstruct} and {JSCallFunction} nodes,
// which might allow inlining or other optimizations to be performed afterwards.
class JSCallReducer final : public AdvancedReducer {
public:
......@@ -55,8 +55,8 @@ class JSCallReducer final : public AdvancedReducer {
Reduction ReduceFunctionPrototypeCall(Node* node);
Reduction ReduceFunctionPrototypeHasInstance(Node* node);
Reduction ReduceObjectPrototypeGetProto(Node* node);
Reduction ReduceJSCallConstruct(Node* node);
Reduction ReduceJSCallConstructWithSpread(Node* node);
Reduction ReduceJSConstruct(Node* node);
Reduction ReduceJSConstructWithSpread(Node* node);
Reduction ReduceJSCallFunction(Node* node);
enum HolderLookup { kHolderNotFound, kHolderIsReceiver, kHolderFound };
......
......@@ -490,9 +490,8 @@ void JSGenericLowering::LowerJSCreateScriptContext(Node* node) {
ReplaceWithRuntimeCall(node, Runtime::kNewScriptContext);
}
void JSGenericLowering::LowerJSCallConstruct(Node* node) {
CallConstructParameters const& p = CallConstructParametersOf(node->op());
void JSGenericLowering::LowerJSConstruct(Node* node) {
ConstructParameters const& p = ConstructParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::Construct(isolate());
......@@ -510,9 +509,9 @@ void JSGenericLowering::LowerJSCallConstruct(Node* node) {
NodeProperties::ChangeOp(node, common()->Call(desc));
}
void JSGenericLowering::LowerJSCallConstructWithSpread(Node* node) {
CallConstructWithSpreadParameters const& p =
CallConstructWithSpreadParametersOf(node->op());
void JSGenericLowering::LowerJSConstructWithSpread(Node* node) {
ConstructWithSpreadParameters const& p =
ConstructWithSpreadParametersOf(node->op());
int const arg_count = static_cast<int>(p.arity() - 2);
CallDescriptor::Flags flags = FrameStateFlagForCall(node);
Callable callable = CodeFactory::ConstructWithSpread(isolate());
......
......@@ -121,7 +121,7 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
CallFunctionParameters const p = CallFunctionParametersOf(node->op());
candidate.frequency = p.frequency();
} else {
CallConstructParameters const p = CallConstructParametersOf(node->op());
ConstructParameters const p = ConstructParametersOf(node->op());
candidate.frequency = p.frequency();
}
......@@ -175,7 +175,7 @@ Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate) {
return reduction;
}
// Expand the JSCallFunction/JSCallConstruct node to a subgraph first if
// Expand the JSCallFunction/JSConstruct node to a subgraph first if
// we have multiple known target functions.
DCHECK_LT(1, num_calls);
Node* calls[kMaxCallPolymorphism + 1];
......
......@@ -31,16 +31,16 @@ namespace compiler {
// Provides convenience accessors for the common layout of nodes having either
// the {JSCallFunction} or the {JSCallConstruct} operator.
// the {JSCallFunction} or the {JSConstruct} operator.
class JSCallAccessor {
public:
explicit JSCallAccessor(Node* call) : call_(call) {
DCHECK(call->opcode() == IrOpcode::kJSCallFunction ||
call->opcode() == IrOpcode::kJSCallConstruct);
call->opcode() == IrOpcode::kJSConstruct);
}
Node* target() {
// Both, {JSCallFunction} and {JSCallConstruct}, have same layout here.
// Both, {JSCallFunction} and {JSConstruct}, have same layout here.
return call_->InputAt(0);
}
......@@ -50,18 +50,18 @@ class JSCallAccessor {
}
Node* new_target() {
DCHECK_EQ(IrOpcode::kJSCallConstruct, call_->opcode());
DCHECK_EQ(IrOpcode::kJSConstruct, call_->opcode());
return call_->InputAt(formal_arguments() + 1);
}
Node* frame_state() {
// Both, {JSCallFunction} and {JSCallConstruct}, have frame state.
// Both, {JSCallFunction} and {JSConstruct}, have frame state.
return NodeProperties::GetFrameStateInput(call_);
}
int formal_arguments() {
// Both, {JSCallFunction} and {JSCallConstruct}, have two extra inputs:
// - JSCallConstruct: Includes target function and new target.
// Both, {JSCallFunction} and {JSConstruct}, have two extra inputs:
// - JSConstruct: Includes target function and new target.
// - JSCallFunction: Includes target function and receiver.
return call_->op()->ValueInputCount() - 2;
}
......@@ -69,7 +69,7 @@ class JSCallAccessor {
float frequency() const {
return (call_->opcode() == IrOpcode::kJSCallFunction)
? CallFunctionParametersOf(call_->op()).frequency()
: CallConstructParametersOf(call_->op()).frequency();
: ConstructParametersOf(call_->op()).frequency();
}
private:
......@@ -354,7 +354,7 @@ Reduction JSInliner::Reduce(Node* node) {
// This reducer can handle both normal function calls as well a constructor
// calls whenever the target is a constant function object, as follows:
// - JSCallFunction(target:constant, receiver, args...)
// - JSCallConstruct(target:constant, args..., new.target)
// - JSConstruct(target:constant, args..., new.target)
HeapObjectMatcher match(node->InputAt(0));
if (!match.HasValue() || !match.Value()->IsJSFunction()) return NoChange();
Handle<JSFunction> function = Handle<JSFunction>::cast(match.Value());
......@@ -384,7 +384,7 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
}
// Constructor must be constructable.
if (node->opcode() == IrOpcode::kJSCallConstruct &&
if (node->opcode() == IrOpcode::kJSConstruct &&
IsNonConstructible(shared_info)) {
TRACE("Not inlining %s into %s because constructor is not constructable.\n",
shared_info->DebugName()->ToCString().get(),
......@@ -550,8 +550,8 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
Node* frame_state = call.frame_state();
Node* new_target = jsgraph()->UndefinedConstant();
// Inline {JSCallConstruct} requires some additional magic.
if (node->opcode() == IrOpcode::kJSCallConstruct) {
// Inline {JSConstruct} requires some additional magic.
if (node->opcode() == IrOpcode::kJSConstruct) {
// Insert nodes around the call that model the behavior required for a
// constructor dispatch (allocate implicit receiver and check return value).
// This models the behavior usually accomplished by our {JSConstructStub}.
......@@ -579,7 +579,7 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
receiver = create; // The implicit receiver.
}
// Swizzle the inputs of the {JSCallConstruct} node to look like inputs to a
// Swizzle the inputs of the {JSConstruct} node to look like inputs to a
// normal {JSCallFunction} node so that the rest of the inlining machinery
// behaves as if we were dealing with a regular function invocation.
new_target = call.new_target(); // Retrieve new target value input.
......
......@@ -52,58 +52,53 @@ ToBooleanHints ToBooleanHintsOf(Operator const* op) {
return OpParameter<ToBooleanHints>(op);
}
bool operator==(CallConstructParameters const& lhs,
CallConstructParameters const& rhs) {
bool operator==(ConstructParameters const& lhs,
ConstructParameters const& rhs) {
return lhs.arity() == rhs.arity() && lhs.frequency() == rhs.frequency() &&
lhs.feedback() == rhs.feedback();
}
bool operator!=(CallConstructParameters const& lhs,
CallConstructParameters const& rhs) {
bool operator!=(ConstructParameters const& lhs,
ConstructParameters const& rhs) {
return !(lhs == rhs);
}
size_t hash_value(CallConstructParameters const& p) {
size_t hash_value(ConstructParameters const& p) {
return base::hash_combine(p.arity(), p.frequency(), p.feedback());
}
std::ostream& operator<<(std::ostream& os, CallConstructParameters const& p) {
std::ostream& operator<<(std::ostream& os, ConstructParameters const& p) {
return os << p.arity() << ", " << p.frequency();
}
CallConstructParameters const& CallConstructParametersOf(Operator const* op) {
DCHECK_EQ(IrOpcode::kJSCallConstruct, op->opcode());
return OpParameter<CallConstructParameters>(op);
ConstructParameters const& ConstructParametersOf(Operator const* op) {
DCHECK_EQ(IrOpcode::kJSConstruct, op->opcode());
return OpParameter<ConstructParameters>(op);
}
bool operator==(CallConstructWithSpreadParameters const& lhs,
CallConstructWithSpreadParameters const& rhs) {
bool operator==(ConstructWithSpreadParameters const& lhs,
ConstructWithSpreadParameters const& rhs) {
return lhs.arity() == rhs.arity();
}
bool operator!=(CallConstructWithSpreadParameters const& lhs,
CallConstructWithSpreadParameters const& rhs) {
bool operator!=(ConstructWithSpreadParameters const& lhs,
ConstructWithSpreadParameters const& rhs) {
return !(lhs == rhs);
}
size_t hash_value(CallConstructWithSpreadParameters const& p) {
size_t hash_value(ConstructWithSpreadParameters const& p) {
return base::hash_combine(p.arity());
}
std::ostream& operator<<(std::ostream& os,
CallConstructWithSpreadParameters const& p) {
ConstructWithSpreadParameters const& p) {
return os << p.arity();
}
CallConstructWithSpreadParameters const& CallConstructWithSpreadParametersOf(
ConstructWithSpreadParameters const& ConstructWithSpreadParametersOf(
Operator const* op) {
DCHECK_EQ(IrOpcode::kJSCallConstructWithSpread, op->opcode());
return OpParameter<CallConstructWithSpreadParameters>(op);
DCHECK_EQ(IrOpcode::kJSConstructWithSpread, op->opcode());
return OpParameter<ConstructWithSpreadParameters>(op);
}
std::ostream& operator<<(std::ostream& os, CallFunctionParameters const& p) {
......@@ -791,23 +786,23 @@ const Operator* JSOperatorBuilder::CallRuntime(const Runtime::Function* f,
parameters); // parameter
}
const Operator* JSOperatorBuilder::CallConstruct(
uint32_t arity, float frequency, VectorSlotPair const& feedback) {
CallConstructParameters parameters(arity, frequency, feedback);
return new (zone()) Operator1<CallConstructParameters>( // --
IrOpcode::kJSCallConstruct, Operator::kNoProperties, // opcode
"JSCallConstruct", // name
parameters.arity(), 1, 1, 1, 1, 2, // counts
parameters); // parameter
const Operator* JSOperatorBuilder::Construct(uint32_t arity, float frequency,
VectorSlotPair const& feedback) {
ConstructParameters parameters(arity, frequency, feedback);
return new (zone()) Operator1<ConstructParameters>( // --
IrOpcode::kJSConstruct, Operator::kNoProperties, // opcode
"JSConstruct", // name
parameters.arity(), 1, 1, 1, 1, 2, // counts
parameters); // parameter
}
const Operator* JSOperatorBuilder::CallConstructWithSpread(uint32_t arity) {
CallConstructWithSpreadParameters parameters(arity);
return new (zone()) Operator1<CallConstructWithSpreadParameters>( // --
IrOpcode::kJSCallConstructWithSpread, Operator::kNoProperties, // opcode
"JSCallConstructWithSpread", // name
parameters.arity(), 1, 1, 1, 1, 2, // counts
parameters); // parameter
const Operator* JSOperatorBuilder::ConstructWithSpread(uint32_t arity) {
ConstructWithSpreadParameters parameters(arity);
return new (zone()) Operator1<ConstructWithSpreadParameters>( // --
IrOpcode::kJSConstructWithSpread, Operator::kNoProperties, // opcode
"JSConstructWithSpread", // name
parameters.arity(), 1, 1, 1, 1, 2, // counts
parameters); // parameter
}
const Operator* JSOperatorBuilder::ConvertReceiver(
......
......@@ -58,11 +58,11 @@ ToBooleanHints ToBooleanHintsOf(Operator const* op);
// Defines the arity and the feedback for a JavaScript constructor call. This is
// used as a parameter by JSCallConstruct operators.
class CallConstructParameters final {
// used as a parameter by JSConstruct operators.
class ConstructParameters final {
public:
CallConstructParameters(uint32_t arity, float frequency,
VectorSlotPair const& feedback)
ConstructParameters(uint32_t arity, float frequency,
VectorSlotPair const& feedback)
: arity_(arity), frequency_(frequency), feedback_(feedback) {}
uint32_t arity() const { return arity_; }
......@@ -75,21 +75,21 @@ class CallConstructParameters final {
VectorSlotPair const feedback_;
};
bool operator==(CallConstructParameters const&, CallConstructParameters const&);
bool operator!=(CallConstructParameters const&, CallConstructParameters const&);
bool operator==(ConstructParameters const&, ConstructParameters const&);
bool operator!=(ConstructParameters const&, ConstructParameters const&);
size_t hash_value(CallConstructParameters const&);
size_t hash_value(ConstructParameters const&);
std::ostream& operator<<(std::ostream&, CallConstructParameters const&);
std::ostream& operator<<(std::ostream&, ConstructParameters const&);
CallConstructParameters const& CallConstructParametersOf(Operator const*);
ConstructParameters const& ConstructParametersOf(Operator const*);
// Defines the arity for a JavaScript constructor call with a spread as the last
// parameters. This is used as a parameter by JSCallConstructWithSpread
// parameters. This is used as a parameter by JSConstructWithSpread
// operators.
class CallConstructWithSpreadParameters final {
class ConstructWithSpreadParameters final {
public:
explicit CallConstructWithSpreadParameters(uint32_t arity) : arity_(arity) {}
explicit ConstructWithSpreadParameters(uint32_t arity) : arity_(arity) {}
uint32_t arity() const { return arity_; }
......@@ -97,17 +97,16 @@ class CallConstructWithSpreadParameters final {
uint32_t const arity_;
};
bool operator==(CallConstructWithSpreadParameters const&,
CallConstructWithSpreadParameters const&);
bool operator!=(CallConstructWithSpreadParameters const&,
CallConstructWithSpreadParameters const&);
bool operator==(ConstructWithSpreadParameters const&,
ConstructWithSpreadParameters const&);
bool operator!=(ConstructWithSpreadParameters const&,
ConstructWithSpreadParameters const&);
size_t hash_value(CallConstructWithSpreadParameters const&);
size_t hash_value(ConstructWithSpreadParameters const&);
std::ostream& operator<<(std::ostream&,
CallConstructWithSpreadParameters const&);
std::ostream& operator<<(std::ostream&, ConstructWithSpreadParameters const&);
CallConstructWithSpreadParameters const& CallConstructWithSpreadParametersOf(
ConstructWithSpreadParameters const& ConstructWithSpreadParametersOf(
Operator const*);
// Defines the flags for a JavaScript call forwarding parameters. This
......@@ -201,7 +200,7 @@ std::ostream& operator<<(std::ostream&, CallFunctionParameters const&);
const CallFunctionParameters& CallFunctionParametersOf(const Operator* op);
// Defines the arity for a JavaScript constructor call with a spread as the last
// parameters. This is used as a parameter by JSCallConstructWithSpread
// parameters. This is used as a parameter by JSConstructWithSpread
// operators.
class CallFunctionWithSpreadParameters final {
public:
......@@ -624,9 +623,9 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
const Operator* CallRuntime(Runtime::FunctionId id);
const Operator* CallRuntime(Runtime::FunctionId id, size_t arity);
const Operator* CallRuntime(const Runtime::Function* function, size_t arity);
const Operator* CallConstruct(uint32_t arity, float frequency,
VectorSlotPair const& feedback);
const Operator* CallConstructWithSpread(uint32_t arity);
const Operator* Construct(uint32_t arity, float frequency,
VectorSlotPair const& feedback);
const Operator* ConstructWithSpread(uint32_t arity);
const Operator* ConvertReceiver(ConvertReceiverMode convert_mode);
......
......@@ -1888,7 +1888,7 @@ void ReduceBuiltin(Isolate* isolate, JSGraph* jsgraph, Node* node,
// The logic contained here is mirrored in Builtins::Generate_Adaptor.
// Keep these in sync.
const bool is_construct = (node->opcode() == IrOpcode::kJSCallConstruct);
const bool is_construct = (node->opcode() == IrOpcode::kJSConstruct);
DCHECK(Builtins::HasCppImplementation(builtin_index));
DCHECK_EQ(0, flags & CallDescriptor::kSupportsTailCalls);
......@@ -1948,9 +1948,9 @@ bool NeedsArgumentAdaptorFrame(Handle<SharedFunctionInfo> shared, int arity) {
} // namespace
Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) {
DCHECK_EQ(IrOpcode::kJSCallConstruct, node->opcode());
CallConstructParameters const& p = CallConstructParametersOf(node->op());
Reduction JSTypedLowering::ReduceJSConstruct(Node* node) {
DCHECK_EQ(IrOpcode::kJSConstruct, node->opcode());
ConstructParameters const& p = ConstructParametersOf(node->op());
DCHECK_LE(2u, p.arity());
int const arity = static_cast<int>(p.arity() - 2);
Node* target = NodeProperties::GetValueInput(node, 0);
......@@ -2412,8 +2412,8 @@ Reduction JSTypedLowering::Reduce(Node* node) {
return ReduceJSStoreModule(node);
case IrOpcode::kJSConvertReceiver:
return ReduceJSConvertReceiver(node);
case IrOpcode::kJSCallConstruct:
return ReduceJSCallConstruct(node);
case IrOpcode::kJSConstruct:
return ReduceJSConstruct(node);
case IrOpcode::kJSCallForwardVarargs:
return ReduceJSCallForwardVarargs(node);
case IrOpcode::kJSCallFunction:
......
......@@ -70,7 +70,7 @@ class V8_EXPORT_PRIVATE JSTypedLowering final
Reduction ReduceJSToString(Node* node);
Reduction ReduceJSToObject(Node* node);
Reduction ReduceJSConvertReceiver(Node* node);
Reduction ReduceJSCallConstruct(Node* node);
Reduction ReduceJSConstruct(Node* node);
Reduction ReduceJSCallForwardVarargs(Node* node);
Reduction ReduceJSCallFunction(Node* node);
Reduction ReduceJSForInNext(Node* node);
......
......@@ -159,8 +159,8 @@
V(JSCreateScriptContext)
#define JS_OTHER_OP_LIST(V) \
V(JSCallConstruct) \
V(JSCallConstructWithSpread) \
V(JSConstruct) \
V(JSConstructWithSpread) \
V(JSCallForwardVarargs) \
V(JSCallFunction) \
V(JSCallFunctionWithSpread) \
......@@ -800,7 +800,7 @@ class V8_EXPORT_PRIVATE IrOpcode {
// Returns true if opcode can be inlined.
static bool IsInlineeOpcode(Value value) {
return value == kJSCallConstruct || value == kJSCallFunction;
return value == kJSConstruct || value == kJSCallFunction;
}
// Returns true if opcode for comparison operator.
......
......@@ -93,8 +93,8 @@ bool OperatorProperties::HasFrameStateInput(const Operator* op) {
case IrOpcode::kJSToString:
// Call operations
case IrOpcode::kJSCallConstruct:
case IrOpcode::kJSCallConstructWithSpread:
case IrOpcode::kJSConstruct:
case IrOpcode::kJSConstructWithSpread:
case IrOpcode::kJSCallForwardVarargs:
case IrOpcode::kJSCallFunction:
case IrOpcode::kJSCallFunctionWithSpread:
......
......@@ -1322,12 +1322,9 @@ Type* Typer::Visitor::TypeJSCreateScriptContext(Node* node) {
// JS other operators.
Type* Typer::Visitor::TypeJSConstruct(Node* node) { return Type::Receiver(); }
Type* Typer::Visitor::TypeJSCallConstruct(Node* node) {
return Type::Receiver();
}
Type* Typer::Visitor::TypeJSCallConstructWithSpread(Node* node) {
Type* Typer::Visitor::TypeJSConstructWithSpread(Node* node) {
return Type::Receiver();
}
......
......@@ -675,8 +675,8 @@ void Verifier::Visitor::Check(Node* node) {
break;
}
case IrOpcode::kJSCallConstruct:
case IrOpcode::kJSCallConstructWithSpread:
case IrOpcode::kJSConstruct:
case IrOpcode::kJSConstructWithSpread:
case IrOpcode::kJSConvertReceiver:
// Type is Receiver.
CheckTypeIs(node, Type::Receiver());
......
......@@ -695,10 +695,10 @@ Node* InterpreterAssembler::CallJSWithSpread(Node* function, Node* context,
first_arg, function);
}
Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Node* new_target, Node* first_arg,
Node* arg_count, Node* slot_id,
Node* type_feedback_vector) {
Node* InterpreterAssembler::Construct(Node* constructor, Node* context,
Node* new_target, Node* first_arg,
Node* arg_count, Node* slot_id,
Node* type_feedback_vector) {
Variable return_value(this, MachineRepresentation::kTagged);
Variable allocation_feedback(this, MachineRepresentation::kTagged);
Label call_construct_function(this, &allocation_feedback),
......@@ -728,7 +728,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Bind(&call_construct_function);
{
Comment("call using callConstructFunction");
Comment("call using ConstructFunction");
IncrementCallCount(type_feedback_vector, slot_id);
Callable callable_function = CodeFactory::InterpreterPushArgsAndConstruct(
isolate(), InterpreterPushArgsMode::kJSFunction);
......@@ -832,7 +832,7 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
Bind(&call_construct);
{
Comment("call using callConstruct builtin");
Comment("call using Construct builtin");
Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(
isolate(), InterpreterPushArgsMode::kOther);
Node* code_target = HeapConstant(callable.code());
......@@ -846,11 +846,10 @@ Node* InterpreterAssembler::CallConstruct(Node* constructor, Node* context,
return return_value.value();
}
Node* InterpreterAssembler::CallConstructWithSpread(Node* constructor,
Node* context,
Node* new_target,
Node* first_arg,
Node* arg_count) {
Node* InterpreterAssembler::ConstructWithSpread(Node* constructor,
Node* context, Node* new_target,
Node* first_arg,
Node* arg_count) {
Variable return_value(this, MachineRepresentation::kTagged);
Comment("call using ConstructWithSpread");
Callable callable = CodeFactory::InterpreterPushArgsAndConstruct(
......
......@@ -145,23 +145,21 @@ class V8_EXPORT_PRIVATE InterpreterAssembler : public CodeStubAssembler {
// |first_arg|. The |new_target| is the same as the
// |constructor| for the new keyword, but differs for the super
// keyword.
compiler::Node* CallConstruct(compiler::Node* constructor,
compiler::Node* context,
compiler::Node* new_target,
compiler::Node* first_arg,
compiler::Node* arg_count,
compiler::Node* slot_id,
compiler::Node* type_feedback_vector);
compiler::Node* Construct(compiler::Node* constructor,
compiler::Node* context, compiler::Node* new_target,
compiler::Node* first_arg,
compiler::Node* arg_count, compiler::Node* slot_id,
compiler::Node* type_feedback_vector);
// Call constructor |constructor| with |arg_count| arguments (not including
// receiver) and the first argument located at |first_arg|. The last argument
// is always a spread. The |new_target| is the same as the |constructor| for
// the new keyword, but differs for the super keyword.
compiler::Node* CallConstructWithSpread(compiler::Node* constructor,
compiler::Node* context,
compiler::Node* new_target,
compiler::Node* first_arg,
compiler::Node* arg_count);
compiler::Node* ConstructWithSpread(compiler::Node* constructor,
compiler::Node* context,
compiler::Node* new_target,
compiler::Node* first_arg,
compiler::Node* arg_count);
// Call runtime function with |arg_count| arguments and the first argument
// located at |first_arg|.
......
......@@ -2213,8 +2213,8 @@ void Interpreter::DoNewWithSpread(InterpreterAssembler* assembler) {
Node* first_arg = __ RegisterLocation(first_arg_reg);
Node* args_count = __ BytecodeOperandCount(2);
Node* context = __ GetContext();
Node* result = __ CallConstructWithSpread(constructor, context, new_target,
first_arg, args_count);
Node* result = __ ConstructWithSpread(constructor, context, new_target,
first_arg, args_count);
__ SetAccumulator(result);
__ Dispatch();
}
......@@ -2235,8 +2235,8 @@ void Interpreter::DoNew(InterpreterAssembler* assembler) {
Node* slot_id = __ BytecodeOperandIdx(3);
Node* type_feedback_vector = __ LoadTypeFeedbackVector();
Node* context = __ GetContext();
Node* result = __ CallConstruct(constructor, context, new_target, first_arg,
args_count, slot_id, type_feedback_vector);
Node* result = __ Construct(constructor, context, new_target, first_arg,
args_count, slot_id, type_feedback_vector);
__ SetAccumulator(result);
__ Dispatch();
}
......
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