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

Unified Diff: runtime/vm/flow_graph_optimizer.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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 40205)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -2962,12 +2962,63 @@
GrowableObjectArray::length_offset(),
new(I) Value(array),
new(I) Value(value),
+ kNoStoreBarrier,
+ call->token_pos());
+ ReplaceCall(call, store);
+ return true;
+ }
+
+ if ((recognized_kind == MethodRecognizer::kBigint_setUsed) &&
+ (ic_data.NumberOfChecks() == 1) &&
+ (class_ids[0] == kBigintCid)) {
+ // This is an internal method, no need to check argument types nor
+ // range.
+ Definition* bigint = call->ArgumentAt(0);
+ Definition* value = call->ArgumentAt(1);
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::used_offset(),
+ new(I) Value(bigint),
+ new(I) Value(value),
+ kNoStoreBarrier,
+ call->token_pos());
+ ReplaceCall(call, store);
+ return true;
+ }
+
+ if ((recognized_kind == MethodRecognizer::kBigint_setDigits) &&
+ (ic_data.NumberOfChecks() == 1) &&
+ (class_ids[0] == kBigintCid)) {
+ // This is an internal method, no need to check argument types nor
+ // range.
+ Definition* bigint = call->ArgumentAt(0);
+ Definition* value = call->ArgumentAt(1);
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::digits_offset(),
+ new(I) Value(bigint),
+ new(I) Value(value),
kEmitStoreBarrier,
call->token_pos());
ReplaceCall(call, store);
return true;
}
+ if ((recognized_kind == MethodRecognizer::kBigint_setNeg) &&
+ (ic_data.NumberOfChecks() == 1) &&
+ (class_ids[0] == kBigintCid)) {
+ // This is an internal method, no need to check argument types nor
+ // range.
+ Definition* bigint = call->ArgumentAt(0);
+ Definition* value = call->ArgumentAt(1);
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::neg_offset(),
+ new(I) Value(bigint),
+ new(I) Value(value),
+ kEmitStoreBarrier,
+ call->token_pos());
+ ReplaceCall(call, store);
+ return true;
+ }
+
if (((recognized_kind == MethodRecognizer::kStringBaseCodeUnitAt) ||
(recognized_kind == MethodRecognizer::kStringBaseCharAt)) &&
(ic_data.NumberOfChecks() == 1) &&
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698