Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1743)

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 562333004: Recognize Bigint setters and getters. This code will be removed when/if we change the fields to be … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698