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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 12077052: Fix double modulo bug by temporary disabling calling to C (fix and reenabling it will follow later)… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/double_modulo_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 d2i_instr = new DoubleToIntegerInstr(call->ArgumentAt(0)->value(), 1367 d2i_instr = new DoubleToIntegerInstr(call->ArgumentAt(0)->value(),
1368 call); 1368 call);
1369 } else { 1369 } else {
1370 // Optimistically assume result fits into Smi. 1370 // Optimistically assume result fits into Smi.
1371 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call); 1371 d2i_instr = new DoubleToSmiInstr(call->ArgumentAt(0)->value(), call);
1372 } 1372 }
1373 call->ReplaceWith(d2i_instr, current_iterator()); 1373 call->ReplaceWith(d2i_instr, current_iterator());
1374 RemovePushArguments(call); 1374 RemovePushArguments(call);
1375 return true; 1375 return true;
1376 } 1376 }
1377 case MethodRecognizer::kDoubleMod: 1377 // TODO(srdjan): C's modulo does not correspond to Dart's modulo.
1378 // Additional checks are required.
1379 // case MethodRecognizer::kDoubleMod:
1378 case MethodRecognizer::kDoublePow: 1380 case MethodRecognizer::kDoublePow:
1379 ReplaceWithMathCFunction(call, recognized_kind); 1381 ReplaceWithMathCFunction(call, recognized_kind);
1380 return true; 1382 return true;
1381 case MethodRecognizer::kDoubleTruncate: 1383 case MethodRecognizer::kDoubleTruncate:
1382 case MethodRecognizer::kDoubleRound: 1384 case MethodRecognizer::kDoubleRound:
1383 case MethodRecognizer::kDoubleFloor: 1385 case MethodRecognizer::kDoubleFloor:
1384 case MethodRecognizer::kDoubleCeil: 1386 case MethodRecognizer::kDoubleCeil:
1385 if (!CPUFeatures::double_truncate_round_supported()) { 1387 if (!CPUFeatures::double_truncate_round_supported()) {
1386 ReplaceWithMathCFunction(call, recognized_kind); 1388 ReplaceWithMathCFunction(call, recognized_kind);
1387 } else { 1389 } else {
(...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4597 4599
4598 if (FLAG_trace_constant_propagation) { 4600 if (FLAG_trace_constant_propagation) {
4599 OS::Print("\n==== After constant propagation ====\n"); 4601 OS::Print("\n==== After constant propagation ====\n");
4600 FlowGraphPrinter printer(*graph_); 4602 FlowGraphPrinter printer(*graph_);
4601 printer.PrintBlocks(); 4603 printer.PrintBlocks();
4602 } 4604 }
4603 } 4605 }
4604 4606
4605 4607
4606 } // namespace dart 4608 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/double_modulo_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698