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

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

Issue 12082063: Enable correct optimized double modulo operation. (TODO: enable remainder optimization). (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 | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('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/code_generator.h" 5 #include "vm/code_generator.h"
6 6
7 #include "vm/assembler_macros.h" 7 #include "vm/assembler_macros.h"
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/bigint_operations.h" 9 #include "vm/bigint_operations.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 if (!(object->IsHeapObject() && value->IsHeapObject())) { 1710 if (!(object->IsHeapObject() && value->IsHeapObject())) {
1711 return; 1711 return;
1712 } 1712 }
1713 HeapTrace* heap_trace = Isolate::Current()->heap()->trace(); 1713 HeapTrace* heap_trace = Isolate::Current()->heap()->trace();
1714 heap_trace->TraceStoreIntoObject(RawObject::ToAddr(object), 1714 heap_trace->TraceStoreIntoObject(RawObject::ToAddr(object),
1715 field_addr, 1715 field_addr,
1716 RawObject::ToAddr(value)); 1716 RawObject::ToAddr(value));
1717 } 1717 }
1718 END_LEAF_RUNTIME_ENTRY 1718 END_LEAF_RUNTIME_ENTRY
1719 1719
1720
1721 double DartModulo(double left, double right) {
1722 double remainder = fmod_ieee(left, right);
1723 if (remainder == 0.0) {
1724 // We explicitely switch to the positive 0.0 (just in case it was negative).
1725 remainder = +0.0;
1726 } else if (remainder < 0.0) {
1727 if (right < 0) {
1728 remainder -= right;
1729 } else {
1730 remainder += right;
1731 }
1732 }
1733 return remainder;
1734 }
1735
1720 } // namespace dart 1736 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698