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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 736113002: Restructure inlining of Bigint accessors, use consistent approach, fixes a potential crash. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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/lib/bigint.dart ('k') | 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 41839)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -3296,6 +3296,23 @@
load->set_recognized_kind(kind);
return ReturnDefinition(load);
}
+ case MethodRecognizer::kBigint_setDigits: {
+ Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+ LocalVariable* value_var =
+ node->scope()->LookupVariable(Symbols::Value(), true);
+ ASSERT(value_var != NULL);
+ Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::digits_offset(),
+ receiver,
+ value,
+ kEmitStoreBarrier,
+ node->token_pos());
+ Do(store);
+ ConstantInstr* null_const = new(I) ConstantInstr(
+ Object::ZoneHandle(I, Object::null()));
+ return ReturnDefinition(null_const);
+ }
case MethodRecognizer::kBigint_getUsed: {
Value* receiver = Bind(BuildLoadThisVar(node->scope()));
LoadFieldInstr* load = new(I) LoadFieldInstr(
@@ -3307,6 +3324,23 @@
load->set_recognized_kind(kind);
return ReturnDefinition(load);
}
+ case MethodRecognizer::kBigint_setUsed: {
+ Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+ LocalVariable* value_var =
+ node->scope()->LookupVariable(Symbols::Value(), true);
+ ASSERT(value_var != NULL);
+ Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::used_offset(),
+ receiver,
+ value,
+ kNoStoreBarrier,
+ node->token_pos());
+ Do(store);
+ ConstantInstr* null_const = new(I) ConstantInstr(
+ Object::ZoneHandle(I, Object::null()));
+ return ReturnDefinition(null_const);
+ }
case MethodRecognizer::kBigint_getNeg: {
Value* receiver = Bind(BuildLoadThisVar(node->scope()));
LoadFieldInstr* load = new(I) LoadFieldInstr(
@@ -3318,6 +3352,23 @@
load->set_recognized_kind(kind);
return ReturnDefinition(load);
}
+ case MethodRecognizer::kBigint_setNeg: {
+ Value* receiver = Bind(BuildLoadThisVar(node->scope()));
+ LocalVariable* value_var =
+ node->scope()->LookupVariable(Symbols::Value(), true);
+ ASSERT(value_var != NULL);
+ Value* value = Bind(new(I) LoadLocalInstr(*value_var));
+ StoreInstanceFieldInstr* store = new(I) StoreInstanceFieldInstr(
+ Bigint::neg_offset(),
+ receiver,
+ value,
+ kEmitStoreBarrier,
+ node->token_pos());
+ Do(store);
+ ConstantInstr* null_const = new(I) ConstantInstr(
+ Object::ZoneHandle(I, Object::null()));
+ return ReturnDefinition(null_const);
+ }
default:
break;
}
« no previous file with comments | « runtime/lib/bigint.dart ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698