summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/simplified-lowering.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/simplified-lowering.cc')
-rw-r--r--deps/v8/src/compiler/simplified-lowering.cc66
1 files changed, 45 insertions, 21 deletions
diff --git a/deps/v8/src/compiler/simplified-lowering.cc b/deps/v8/src/compiler/simplified-lowering.cc
index f24f000887..74bb7fcd6b 100644
--- a/deps/v8/src/compiler/simplified-lowering.cc
+++ b/deps/v8/src/compiler/simplified-lowering.cc
@@ -286,8 +286,8 @@ class RepresentationSelector {
bool weakened_ = false;
};
- RepresentationSelector(JSGraph* jsgraph, Zone* zone,
- RepresentationChanger* changer,
+ RepresentationSelector(JSGraph* jsgraph, const JSHeapBroker* js_heap_broker,
+ Zone* zone, RepresentationChanger* changer,
SourcePositionTable* source_positions,
NodeOriginTable* node_origins)
: jsgraph_(jsgraph),
@@ -306,7 +306,7 @@ class RepresentationSelector {
source_positions_(source_positions),
node_origins_(node_origins),
type_cache_(TypeCache::Get()),
- op_typer_(jsgraph->isolate(), graph_zone()) {
+ op_typer_(jsgraph->isolate(), js_heap_broker, graph_zone()) {
}
// Forward propagation of types from type feedback.
@@ -537,7 +537,7 @@ class RepresentationSelector {
}
void PrintNodeFeedbackType(Node* n) {
- OFStream os(stdout);
+ StdoutStream os;
os << "#" << n->id() << ":" << *n->op() << "(";
int j = 0;
for (Node* const i : n->inputs()) {
@@ -2630,6 +2630,17 @@ class RepresentationSelector {
SetOutput(node, rep);
return;
}
+ case IrOpcode::kLoadDataViewElement: {
+ MachineRepresentation const rep =
+ MachineRepresentationFromArrayType(ExternalArrayTypeOf(node->op()));
+ ProcessInput(node, 0, UseInfo::AnyTagged()); // buffer
+ ProcessInput(node, 1, UseInfo::PointerInt()); // external pointer
+ ProcessInput(node, 2, UseInfo::TruncatingWord32()); // index
+ ProcessInput(node, 3, UseInfo::Bool()); // little-endian
+ ProcessRemainingInputs(node, 4);
+ SetOutput(node, rep);
+ return;
+ }
case IrOpcode::kStoreTypedElement: {
MachineRepresentation const rep =
MachineRepresentationFromArrayType(ExternalArrayTypeOf(node->op()));
@@ -2643,6 +2654,19 @@ class RepresentationSelector {
SetOutput(node, MachineRepresentation::kNone);
return;
}
+ case IrOpcode::kStoreDataViewElement: {
+ MachineRepresentation const rep =
+ MachineRepresentationFromArrayType(ExternalArrayTypeOf(node->op()));
+ ProcessInput(node, 0, UseInfo::AnyTagged()); // buffer
+ ProcessInput(node, 1, UseInfo::PointerInt()); // external pointer
+ ProcessInput(node, 2, UseInfo::TruncatingWord32()); // index
+ ProcessInput(node, 3,
+ TruncatingUseInfoFromRepresentation(rep)); // value
+ ProcessInput(node, 4, UseInfo::Bool()); // little-endian
+ ProcessRemainingInputs(node, 5);
+ SetOutput(node, MachineRepresentation::kNone);
+ return;
+ }
case IrOpcode::kConvertReceiver: {
Type input_type = TypeOf(node->InputAt(0));
VisitBinop(node, UseInfo::AnyTagged(),
@@ -3188,29 +3212,26 @@ class RepresentationSelector {
void PrintOutputInfo(NodeInfo* info) {
if (FLAG_trace_representation) {
- OFStream os(stdout);
- os << info->representation();
+ StdoutStream{} << info->representation();
}
}
void PrintRepresentation(MachineRepresentation rep) {
if (FLAG_trace_representation) {
- OFStream os(stdout);
- os << rep;
+ StdoutStream{} << rep;
}
}
void PrintTruncation(Truncation truncation) {
if (FLAG_trace_representation) {
- OFStream os(stdout);
- os << truncation.description() << std::endl;
+ StdoutStream{} << truncation.description() << std::endl;
}
}
void PrintUseInfo(UseInfo info) {
if (FLAG_trace_representation) {
- OFStream os(stdout);
- os << info.representation() << ":" << info.truncation().description();
+ StdoutStream{} << info.representation() << ":"
+ << info.truncation().description();
}
}
@@ -3252,11 +3273,14 @@ class RepresentationSelector {
Zone* graph_zone() { return jsgraph_->zone(); }
};
-SimplifiedLowering::SimplifiedLowering(JSGraph* jsgraph, Zone* zone,
+SimplifiedLowering::SimplifiedLowering(JSGraph* jsgraph,
+ const JSHeapBroker* js_heap_broker,
+ Zone* zone,
SourcePositionTable* source_positions,
NodeOriginTable* node_origins,
PoisoningMitigationLevel poisoning_level)
: jsgraph_(jsgraph),
+ js_heap_broker_(js_heap_broker),
zone_(zone),
type_cache_(TypeCache::Get()),
source_positions_(source_positions),
@@ -3265,8 +3289,8 @@ SimplifiedLowering::SimplifiedLowering(JSGraph* jsgraph, Zone* zone,
void SimplifiedLowering::LowerAllNodes() {
RepresentationChanger changer(jsgraph(), jsgraph()->isolate());
- RepresentationSelector selector(jsgraph(), zone_, &changer, source_positions_,
- node_origins_);
+ RepresentationSelector selector(jsgraph(), js_heap_broker_, zone_, &changer,
+ source_positions_, node_origins_);
selector.Run(this);
}
@@ -3910,9 +3934,9 @@ Operator const* SimplifiedLowering::ToNumberOperator() {
if (!to_number_operator_.is_set()) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToNumber);
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState;
- auto call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), graph()->zone(), callable.descriptor(), 0, flags,
- Operator::kNoProperties);
+ auto call_descriptor =
+ Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(),
+ 0, flags, Operator::kNoProperties);
to_number_operator_.set(common()->Call(call_descriptor));
}
return to_number_operator_.get();
@@ -3922,9 +3946,9 @@ Operator const* SimplifiedLowering::ToNumericOperator() {
if (!to_numeric_operator_.is_set()) {
Callable callable = Builtins::CallableFor(isolate(), Builtins::kToNumeric);
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState;
- auto call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), graph()->zone(), callable.descriptor(), 0, flags,
- Operator::kNoProperties);
+ auto call_descriptor =
+ Linkage::GetStubCallDescriptor(graph()->zone(), callable.descriptor(),
+ 0, flags, Operator::kNoProperties);
to_numeric_operator_.set(common()->Call(call_descriptor));
}
return to_numeric_operator_.get();