[turbofan] Remove a heap access from JSIntrinsicLowering
Bug: v8:7790 Change-Id: I9a770fd6861c216121aef88f0119698edc0e224e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1763537 Commit-Queue: Georg Neis <neis@chromium.org> Commit-Queue: Maya Lekova <mslekova@chromium.org> Auto-Submit: Georg Neis <neis@chromium.org> Reviewed-by: Maya Lekova <mslekova@chromium.org> Cr-Commit-Position: refs/heads/master@{#63316}
This commit is contained in:
parent
74257189e9
commit
882f8c6b89
@ -21,8 +21,9 @@ namespace v8 {
|
|||||||
namespace internal {
|
namespace internal {
|
||||||
namespace compiler {
|
namespace compiler {
|
||||||
|
|
||||||
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph)
|
JSIntrinsicLowering::JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph,
|
||||||
: AdvancedReducer(editor), jsgraph_(jsgraph) {}
|
JSHeapBroker* broker)
|
||||||
|
: AdvancedReducer(editor), jsgraph_(jsgraph), broker_(broker) {}
|
||||||
|
|
||||||
Reduction JSIntrinsicLowering::Reduce(Node* node) {
|
Reduction JSIntrinsicLowering::Reduce(Node* node) {
|
||||||
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining);
|
DisallowHeapAccessIf no_heap_access(FLAG_concurrent_inlining);
|
||||||
@ -309,7 +310,7 @@ Reduction JSIntrinsicLowering::ReduceToObject(Node* node) {
|
|||||||
Reduction JSIntrinsicLowering::ReduceToString(Node* node) {
|
Reduction JSIntrinsicLowering::ReduceToString(Node* node) {
|
||||||
// ToString is unnecessary if the input is a string.
|
// ToString is unnecessary if the input is a string.
|
||||||
HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0));
|
HeapObjectMatcher m(NodeProperties::GetValueInput(node, 0));
|
||||||
if (m.HasValue() && m.Value()->IsString()) {
|
if (m.HasValue() && m.Ref(broker()).IsString()) {
|
||||||
ReplaceWithValue(node, m.node());
|
ReplaceWithValue(node, m.node());
|
||||||
return Replace(m.node());
|
return Replace(m.node());
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class SimplifiedOperatorBuilder;
|
|||||||
class V8_EXPORT_PRIVATE JSIntrinsicLowering final
|
class V8_EXPORT_PRIVATE JSIntrinsicLowering final
|
||||||
: public NON_EXPORTED_BASE(AdvancedReducer) {
|
: public NON_EXPORTED_BASE(AdvancedReducer) {
|
||||||
public:
|
public:
|
||||||
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph);
|
JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, JSHeapBroker* broker);
|
||||||
~JSIntrinsicLowering() final = default;
|
~JSIntrinsicLowering() final = default;
|
||||||
|
|
||||||
const char* reducer_name() const override { return "JSIntrinsicLowering"; }
|
const char* reducer_name() const override { return "JSIntrinsicLowering"; }
|
||||||
@ -81,12 +81,14 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
|
|||||||
|
|
||||||
Graph* graph() const;
|
Graph* graph() const;
|
||||||
JSGraph* jsgraph() const { return jsgraph_; }
|
JSGraph* jsgraph() const { return jsgraph_; }
|
||||||
|
JSHeapBroker* broker() const { return broker_; }
|
||||||
Isolate* isolate() const;
|
Isolate* isolate() const;
|
||||||
CommonOperatorBuilder* common() const;
|
CommonOperatorBuilder* common() const;
|
||||||
JSOperatorBuilder* javascript() const;
|
JSOperatorBuilder* javascript() const;
|
||||||
SimplifiedOperatorBuilder* simplified() const;
|
SimplifiedOperatorBuilder* simplified() const;
|
||||||
|
|
||||||
JSGraph* const jsgraph_;
|
JSGraph* const jsgraph_;
|
||||||
|
JSHeapBroker* const broker_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace compiler
|
} // namespace compiler
|
||||||
|
@ -1268,7 +1268,8 @@ struct InliningPhase {
|
|||||||
: JSInliningHeuristic::kRestrictedInlining,
|
: JSInliningHeuristic::kRestrictedInlining,
|
||||||
temp_zone, data->info(), data->jsgraph(),
|
temp_zone, data->info(), data->jsgraph(),
|
||||||
data->broker(), data->source_positions());
|
data->broker(), data->source_positions());
|
||||||
JSIntrinsicLowering intrinsic_lowering(&graph_reducer, data->jsgraph());
|
JSIntrinsicLowering intrinsic_lowering(&graph_reducer, data->jsgraph(),
|
||||||
|
data->broker());
|
||||||
AddReducer(data, &graph_reducer, &dead_code_elimination);
|
AddReducer(data, &graph_reducer, &dead_code_elimination);
|
||||||
AddReducer(data, &graph_reducer, &checkpoint_elimination);
|
AddReducer(data, &graph_reducer, &checkpoint_elimination);
|
||||||
AddReducer(data, &graph_reducer, &common_reducer);
|
AddReducer(data, &graph_reducer, &common_reducer);
|
||||||
|
@ -37,7 +37,7 @@ class JSIntrinsicLoweringTest : public GraphTest {
|
|||||||
&machine);
|
&machine);
|
||||||
// TODO(titzer): mock the GraphReducer here for better unit testing.
|
// TODO(titzer): mock the GraphReducer here for better unit testing.
|
||||||
GraphReducer graph_reducer(zone(), graph(), tick_counter());
|
GraphReducer graph_reducer(zone(), graph(), tick_counter());
|
||||||
JSIntrinsicLowering reducer(&graph_reducer, &jsgraph);
|
JSIntrinsicLowering reducer(&graph_reducer, &jsgraph, broker());
|
||||||
return reducer.Reduce(node);
|
return reducer.Reduce(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user