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

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

Issue 8430037: Fix issue: 5427703 (compareTo), fix parsing of -0.0. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/double.dart ('k') | tests/co19/co19-runtime.status » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/ast.h" 5 #include "vm/ast.h"
6 #include "vm/compiler.h" 6 #include "vm/compiler.h"
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 Smi& smi = Smi::Handle(); 86 Smi& smi = Smi::Handle();
87 smi ^= literal().raw(); 87 smi ^= literal().raw();
88 const Instance& literal = 88 const Instance& literal =
89 Instance::ZoneHandle(Integer::New(-smi.Value())); 89 Instance::ZoneHandle(Integer::New(-smi.Value()));
90 return new LiteralNode(this->token_index(), literal); 90 return new LiteralNode(this->token_index(), literal);
91 } 91 }
92 if (literal().IsDouble()) { 92 if (literal().IsDouble()) {
93 Double& dbl = Double::Handle(); 93 Double& dbl = Double::Handle();
94 dbl ^= literal().raw(); 94 dbl ^= literal().raw();
95 // Preserve negative zero. 95 // Preserve negative zero.
96 const Instance& literal = 96 double new_value = (dbl.value() == 0.0) ? -0.0 : (0.0 - dbl.value());
97 Instance::ZoneHandle(Double::New(0.0 - dbl.value())); 97 const Instance& literal = Instance::ZoneHandle(Double::New(new_value));
98 return new LiteralNode(this->token_index(), literal); 98 return new LiteralNode(this->token_index(), literal);
99 } 99 }
100 } 100 }
101 return NULL; 101 return NULL;
102 } 102 }
103 103
104 104
105 bool ComparisonNode::IsKindValid() const { 105 bool ComparisonNode::IsKindValid() const {
106 return Token::IsRelationalOperator(kind_) 106 return Token::IsRelationalOperator(kind_)
107 || Token::IsEqualityOperator(kind_) 107 || Token::IsEqualityOperator(kind_)
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (field_value.IsUnhandledException()) { 445 if (field_value.IsUnhandledException()) {
446 return NULL; 446 return NULL;
447 } 447 }
448 if (!field_value.IsNull()) { 448 if (!field_value.IsNull()) {
449 return &field_value; 449 return &field_value;
450 } 450 }
451 return NULL; 451 return NULL;
452 } 452 }
453 453
454 } // namespace dart 454 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/double.dart ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698