| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |