DescriptionAdd a smi-check instruction for arithmetic smi operations.
The flowgraph optimizer inserts smi checks for the inputs of
arithmetic smi operations:
PushArgument v0
PushArgument v1
v2 <- InstanceCall(+, v0, v1) IC[1: Smi, Smi]
becomes
CheckSmi(v0)
CheckSmi(v1)
v2 <- BinarySmiOp(+, v0, v1)
Each input operand is checked separately. This avoids using a temp
register for a combined smi check. It also allows us to easily eliminate
the checks for left and right input separately.
There are two ways to eliminate smi checks:
1. By common subexpression elimination: if the value checked is already
checked for smi-ness before.
2. By class-id propagation: If the input value is guaranteed to be a smi.
Committed: https://code.google.com/p/dart/source/detail?r=11216
Patch Set 1 #
Total comments: 10
Patch Set 2 : addressed comments #
Messages
Total messages: 3 (0 generated)
|