Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 double new_value = (dbl.value() == 0.0) ? -0.0 : (0.0 - dbl.value()); | 96 double new_value = (dbl.value() == 0.0) ? -0.0 : (0.0 - dbl.value()); |
| 97 const Instance& literal = Instance::ZoneHandle(Double::New(new_value)); | 97 Double& double_instance = Double::ZoneHandle(Double::New(new_value)); |
|
siva
2011/12/12 18:50:30
Do you want to allocate this also in the old space
srdjan
2011/12/21 22:30:17
Done.
| |
| 98 return new LiteralNode(this->token_index(), literal); | 98 double_instance ^= double_instance.Canonicalize(); |
| 99 return new LiteralNode(this->token_index(), double_instance); | |
| 99 } | 100 } |
| 100 } | 101 } |
| 101 return NULL; | 102 return NULL; |
| 102 } | 103 } |
| 103 | 104 |
| 104 | 105 |
| 105 bool ComparisonNode::IsKindValid() const { | 106 bool ComparisonNode::IsKindValid() const { |
| 106 return Token::IsRelationalOperator(kind_) | 107 return Token::IsRelationalOperator(kind_) |
| 107 || Token::IsEqualityOperator(kind_) | 108 || Token::IsEqualityOperator(kind_) |
| 108 || Token::IsInstanceofOperator(kind_); | 109 || Token::IsInstanceofOperator(kind_); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 445 if (field_value.IsUnhandledException()) { | 446 if (field_value.IsUnhandledException()) { |
| 446 return NULL; | 447 return NULL; |
| 447 } | 448 } |
| 448 if (!field_value.IsNull()) { | 449 if (!field_value.IsNull()) { |
| 449 return &field_value; | 450 return &field_value; |
| 450 } | 451 } |
| 451 return NULL; | 452 return NULL; |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace dart | 455 } // namespace dart |
| OLD | NEW |