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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 509153003: New bigint implementation in the vm. (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
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 40060)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -8250,7 +8250,7 @@
const Object& left = left_val.definition()->constant_value();
const Object& right = right_val.definition()->constant_value();
if (IsNonConstant(left) || IsNonConstant(right)) {
- // TODO(srdjan): Add arithemtic simplifications, e.g, add with 0.
+ // TODO(srdjan): Add arithmetic simplifications, e.g, add with 0.
SetValue(instr, non_constant_);
} else if (IsConstant(left) && IsConstant(right)) {
if (left.IsInteger() && right.IsInteger()) {
@@ -8270,6 +8270,12 @@
case Token::kMUL: {
Instance& result = Integer::ZoneHandle(I,
left_int.ArithmeticOp(op_kind, right_int));
+ if (result.IsNull()) {
+ // TODO(regis): A bigint operation is required. Invoke dart?
+ // Punt for now.
+ SetValue(instr, non_constant_);
+ break;
+ }
result = result.CheckAndCanonicalize(NULL);
ASSERT(!result.IsNull());
SetValue(instr, result);
@@ -8280,6 +8286,12 @@
if (left.IsSmi() && right.IsSmi()) {
Instance& result = Integer::ZoneHandle(I,
Smi::Cast(left_int).ShiftOp(op_kind, Smi::Cast(right_int)));
+ if (result.IsNull()) {
+ // TODO(regis): A bigint operation is required. Invoke dart?
+ // Punt for now.
+ SetValue(instr, non_constant_);
+ break;
+ }
result = result.CheckAndCanonicalize(NULL);
ASSERT(!result.IsNull());
SetValue(instr, result);

Powered by Google App Engine
This is Rietveld 408576698