Commit 4686448a authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Simplify and fix JS typed lowering type init.

Removing and fixing some embarrassing stuff in js-typed-lowering.

BUG=
R=bmeurer@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26991}
parent 118f97e7
......@@ -38,26 +38,14 @@ static void RelaxControls(Node* node) {
JSTypedLowering::JSTypedLowering(JSGraph* jsgraph, Zone* zone)
: jsgraph_(jsgraph), simplified_(graph()->zone()), conversions_(zone) {
zero_range_ = Type::Range(0.0, 1.0, graph()->zone());
zero_range_ = Type::Range(0.0, 0.0, graph()->zone());
one_range_ = Type::Range(1.0, 1.0, graph()->zone());
zero_thirtyone_range_ = Type::Range(0.0, 31.0, graph()->zone());
// TODO(jarin): Can we have a correctification of the stupid type system?
// These stupid work-arounds are just stupid!
shifted_int32_ranges_[0] = Type::Signed32();
if (SmiValuesAre31Bits()) {
shifted_int32_ranges_[1] = Type::SignedSmall();
for (size_t k = 2; k < arraysize(shifted_int32_ranges_); ++k) {
for (size_t k = 0; k < arraysize(shifted_int32_ranges_); ++k) {
double min = kMinInt / (1 << k);
double max = kMaxInt / (1 << k);
shifted_int32_ranges_[k] = Type::Range(min, max, graph()->zone());
}
} else {
for (size_t k = 1; k < arraysize(shifted_int32_ranges_); ++k) {
double min = kMinInt / (1 << k);
double max = kMaxInt / (1 << k);
shifted_int32_ranges_[k] = Type::Range(min, max, graph()->zone());
}
}
}
......
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