Commit 11a950fc authored by svenpanne's avatar svenpanne Committed by Commit bot

Fixed race condition in HBranch::observed_input_representation.

Non-numeric static local variables are not thread-safe, and the case
at hand was a premature optimization anyway: The generated code for
the check in question is exactly the same when unfolded.

BUG=chromium:420483

Review URL: https://codereview.chromium.org/756903003

Cr-Commit-Position: refs/heads/master@{#25502}
parent d15d453f
......@@ -1155,12 +1155,10 @@ std::ostream& HReturn::PrintDataTo(std::ostream& os) const { // NOLINT
Representation HBranch::observed_input_representation(int index) {
static const ToBooleanStub::Types tagged_types(
ToBooleanStub::NULL_TYPE |
ToBooleanStub::SPEC_OBJECT |
ToBooleanStub::STRING |
ToBooleanStub::SYMBOL);
if (expected_input_types_.ContainsAnyOf(tagged_types)) {
if (expected_input_types_.Contains(ToBooleanStub::NULL_TYPE) ||
expected_input_types_.Contains(ToBooleanStub::SPEC_OBJECT) ||
expected_input_types_.Contains(ToBooleanStub::STRING) ||
expected_input_types_.Contains(ToBooleanStub::SYMBOL)) {
return Representation::Tagged();
}
if (expected_input_types_.Contains(ToBooleanStub::UNDEFINED)) {
......
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