Commit 66ca9c83 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Compute more precise type for ObjectIsSmi if possible.

The typer can infer true/false for ObjectIsSmi if the argument has a
fixed/known representation (i.e. is either known to be smi or heap
object).

R=jarin@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#31354}
parent f9a9c6be
......@@ -1657,7 +1657,13 @@ Type* Typer::Visitor::TypeStoreElement(Node* node) {
}
Type* Typer::Visitor::TypeObjectIsSmi(Node* node) { return Type::Boolean(); }
Type* Typer::Visitor::TypeObjectIsSmi(Node* node) {
Type* arg = Operand(node, 0);
if (arg->Is(Type::None())) return Type::None();
if (arg->Is(Type::TaggedSigned())) return typer_->singleton_true_;
if (arg->Is(Type::TaggedPointer())) return typer_->singleton_false_;
return Type::Boolean();
}
// Machine operators.
......
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