Commit bb118e5e authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[gasm] Implement ReduceArrayPrototypeMap using the graph assembler

Ports are getting easier now. This one was fairly straightforward.

Bug: v8:9972
Change-Id: I69c0566060523e505e30980cb1d3d9633da976b0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1940257
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65246}
parent e6b7d62e
......@@ -377,8 +377,13 @@ Node* GraphAssembler::Float64Constant(double value) {
return AddClonedNode(jsgraph()->Float64Constant(value));
}
Node* GraphAssembler::HeapConstant(Handle<HeapObject> object) {
return AddClonedNode(jsgraph()->HeapConstant(object));
TNode<HeapObject> GraphAssembler::HeapConstant(Handle<HeapObject> object) {
return TNode<HeapObject>::UncheckedCast(
AddClonedNode(jsgraph()->HeapConstant(object)));
}
TNode<Object> GraphAssembler::Constant(const ObjectRef& ref) {
return TNode<Object>::UncheckedCast(AddClonedNode(jsgraph()->Constant(ref)));
}
TNode<Number> GraphAssembler::NumberConstant(double value) {
......@@ -511,6 +516,16 @@ Node* GraphAssembler::StoreElement(ElementAccess const& access, Node* object,
index, value, effect(), control()));
}
void GraphAssembler::TransitionAndStoreElement(MapRef double_map,
MapRef fast_map,
TNode<HeapObject> object,
TNode<Number> index,
TNode<Object> value) {
AddNode(graph()->NewNode(simplified()->TransitionAndStoreElement(
double_map.object(), fast_map.object()),
object, index, value, effect(), control()));
}
TNode<Number> GraphAssembler::StringLength(TNode<String> string) {
return AddNode<Number>(
graph()->NewNode(simplified()->StringLength(), string));
......
......@@ -193,6 +193,16 @@ class GraphAssemblerLabel {
}
}
// Multiple merge variables with the same representation.
explicit GraphAssemblerLabel(GraphAssemblerLabelType type,
BasicBlock* basic_block,
MachineRepresentation rep)
: type_(type), basic_block_(basic_block) {
for (size_t i = 0; i < VarCount; i++) {
representations_[i] = rep;
}
}
~GraphAssemblerLabel() { DCHECK(IsBound() || merged_count_ == 0); }
private:
......@@ -265,7 +275,8 @@ class V8_EXPORT_PRIVATE GraphAssembler {
Node* SmiConstant(int32_t value);
Node* Float64Constant(double value);
Node* Projection(int index, Node* value);
Node* HeapConstant(Handle<HeapObject> object);
TNode<HeapObject> HeapConstant(Handle<HeapObject> object);
TNode<Object> Constant(const ObjectRef& ref);
TNode<Number> NumberConstant(double value);
Node* CEntryStubConstant(int result_size);
Node* ExternalConstant(ExternalReference ref);
......@@ -329,6 +340,9 @@ class V8_EXPORT_PRIVATE GraphAssembler {
Node* StoreField(FieldAccess const&, Node* object, Node* value);
Node* StoreElement(ElementAccess const&, Node* object, Node* index,
Node* value);
void TransitionAndStoreElement(MapRef double_map, MapRef fast_map,
TNode<HeapObject> object, TNode<Number> index,
TNode<Object> value);
TNode<Number> StringLength(TNode<String> string);
TNode<Boolean> ReferenceEqual(TNode<Object> lhs, TNode<Object> rhs);
TNode<Number> NumberMin(TNode<Number> lhs, TNode<Number> rhs);
......
This diff is collapsed.
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