Chromium Code Reviews| Index: runtime/vm/flow_graph_type_propagator.cc |
| diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc |
| index 0501f6a944faa1ea535e2d1ad5a2cee2c6c317cb..39c5dfc2e88a7c4f1bf3d744c63a65de5959c30e 100644 |
| --- a/runtime/vm/flow_graph_type_propagator.cc |
| +++ b/runtime/vm/flow_graph_type_propagator.cc |
| @@ -7,6 +7,7 @@ |
| #include "vm/cha.h" |
| #include "vm/bit_vector.h" |
| #include "vm/il_printer.h" |
| +#include "vm/regexp_assembler.h" |
| namespace dart { |
| @@ -714,6 +715,21 @@ CompileType ParameterInstr::ComputeType() const { |
| } |
| const Function& function = graph_entry->parsed_function().function(); |
| + if (function.IsIrregexpFunction()) { |
| + // In irregexp functions, types of input parameters are known and immutable. |
| + // Set parameter types here in order to prevent unnecessary CheckClassInstr |
| + // from being generated. |
| + switch (index()) { |
| + case RegExpMacroAssembler::kParamStringIndex: |
| + return CompileType::FromCid(function.regexp_cid()); |
| + case RegExpMacroAssembler::kParamStartOffsetIndex: |
| + return CompileType::FromCid(kSmiCid); |
| + default: UNREACHABLE(); |
| + } |
| + UNREACHABLE(); |
| + return CompileType::Dynamic(); |
| + } |
| + |
| LocalScope* scope = graph_entry->parsed_function().node_sequence()->scope(); |
| const AbstractType& type = scope->VariableAt(index())->type(); |
| @@ -1011,6 +1027,28 @@ CompileType LoadFieldInstr::ComputeType() const { |
| } |
| +CompileType LoadCodeUnitsInstr::ComputeType() const { |
|
zerny-google
2014/10/07 12:18:35
Maybe just remove the "fast path" and make the rel
jgruber1
2014/10/07 15:00:25
Done. I didn't add the enum/const since the elemen
|
| + if (kSmiBits >= 32) { |
| + // If Smis have at least 32 bits, we can stuff everything into a single Smi. |
| + return CompileType::FromCid(kSmiCid); |
| + } |
| + |
| + switch (class_id()) { |
| + case kOneByteStringCid: |
| + case kExternalOneByteStringCid: |
| + return element_count() < 4 ? CompileType::FromCid(kSmiCid) |
| + : CompileType::Int(); |
| + case kTwoByteStringCid: |
| + case kExternalTwoByteStringCid: |
| + return element_count() < 2 ? CompileType::FromCid(kSmiCid) |
| + : CompileType::Int(); |
| + default: |
| + UNIMPLEMENTED(); |
| + return CompileType::Dynamic(); |
| + } |
| +} |
| + |
| + |
| CompileType BinaryInt32OpInstr::ComputeType() const { |
| // TODO(vegorov): range analysis information shall be used here. |
| return CompileType::Int(); |
| @@ -1288,6 +1326,11 @@ CompileType MathMinMaxInstr::ComputeType() const { |
| } |
| +CompileType CaseInsensitiveCompareUC16Instr::ComputeType() const { |
| + return CompileType::FromCid(kBoolCid); |
| +} |
| + |
| + |
| CompileType UnboxDoubleInstr::ComputeType() const { |
| return CompileType::FromCid(kDoubleCid); |
| } |