Commit 5d8cfbbd authored by ahaas's avatar ahaas Committed by Commit bot

[turbofan] Don't call String::Flatten in Constant::ToHeapObject()

The call to String::Flatten can cause garbage collection and in general adds
complexity to the code generation. It also blocks the way to run code generation on worker threads.

The call to String::Flatten in Constant::ToHeapObject() seems not to be necessary
for correctness. If removing this call affects performance negatively, we can revert
this CL.

Review-Url: https://codereview.chromium.org/2107243002
Cr-Commit-Position: refs/heads/master@{#37422}
parent 9e12b838
......@@ -527,9 +527,6 @@ Handle<HeapObject> Constant::ToHeapObject() const {
DCHECK_EQ(kHeapObject, type());
Handle<HeapObject> value(
bit_cast<HeapObject**>(static_cast<intptr_t>(value_)));
if (value->IsConsString()) {
value = String::Flatten(Handle<String>::cast(value), TENURED);
}
return value;
}
......
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