Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_builder.cc (revision 40168) |
| +++ runtime/vm/flow_graph_builder.cc (working copy) |
| @@ -3275,6 +3275,40 @@ |
| new CreateArrayInstr(node->token_pos(), element_type, length); |
| return ReturnDefinition(create_array); |
| } |
| + case MethodRecognizer::kBigint_getDigits: { |
| + Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| + LoadFieldInstr* load = new(I) LoadFieldInstr( |
| + receiver, |
| + Bigint::digits_offset(), |
| + Type::ZoneHandle(I, Type::DynamicType()), |
| + node->token_pos()); |
| + // TODO(srdjan): Make this kTypedDataUint32ArrayCid. |
| + load->set_result_cid(kDynamicCid); |
|
regis
2014/09/11 22:33:30
Why can't you do it now?
srdjan
2014/09/11 22:44:20
I must keep the type (passed to LoadFieldInstr) an
Florian Schneider
2014/09/12 09:17:39
I think it should just work to set result_cid, but
srdjan
2014/09/12 15:29:35
Currently it throws an NPE. Will investigate in ne
srdjan
2014/09/18 16:12:54
It throws an NPE because it is sometimes NULL and
|
| + load->set_recognized_kind(kind); |
| + return ReturnDefinition(load); |
| + } |
| + case MethodRecognizer::kBigint_getUsed: { |
| + Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| + LoadFieldInstr* load = new(I) LoadFieldInstr( |
| + receiver, |
| + Bigint::used_offset(), |
| + Type::ZoneHandle(I, Type::SmiType()), |
| + node->token_pos()); |
| + load->set_result_cid(kSmiCid); |
| + load->set_recognized_kind(kind); |
| + return ReturnDefinition(load); |
| + } |
| + case MethodRecognizer::kBigint_getNeg: { |
| + Value* receiver = Bind(BuildLoadThisVar(node->scope())); |
| + LoadFieldInstr* load = new(I) LoadFieldInstr( |
| + receiver, |
| + Bigint::neg_offset(), |
| + Type::ZoneHandle(I, Type::BoolType()), |
| + node->token_pos()); |
| + load->set_result_cid(kBoolCid); |
| + load->set_recognized_kind(kind); |
| + return ReturnDefinition(load); |
| + } |
| default: |
| break; |
| } |