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 #include "vm/resolver.h" | 10 #include "vm/resolver.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_pos(), literal); | 90 return new LiteralNode(this->token_pos(), literal); |
91 } | 91 } |
92 if (literal().IsDouble()) { | 92 if (literal().IsDouble()) { |
93 const Double& dbl = Double::Cast(literal()); | 93 const Double& dbl = Double::Cast(literal()); |
94 // Preserve negative zero. | 94 // Preserve negative zero. |
95 double new_value = (dbl.value() == 0.0) ? -0.0 : (0.0 - dbl.value()); | 95 double new_value = (dbl.value() == 0.0) ? -0.0 : (0.0 - dbl.value()); |
96 Double& double_instance = | 96 Double& double_instance = |
97 Double::ZoneHandle(Double::New(new_value, Heap::kOld)); | 97 Double::ZoneHandle(Double::New(new_value, Heap::kOld)); |
98 double_instance |= double_instance.Canonicalize(); | 98 double_instance ^= double_instance.Canonicalize(); |
99 return new LiteralNode(this->token_pos(), double_instance); | 99 return new LiteralNode(this->token_pos(), double_instance); |
100 } | 100 } |
101 } | 101 } |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
104 | 104 |
105 | 105 |
106 bool ComparisonNode::IsKindValid() const { | 106 bool ComparisonNode::IsKindValid() const { |
107 return Token::IsRelationalOperator(kind_) | 107 return Token::IsRelationalOperator(kind_) |
108 || Token::IsEqualityOperator(kind_) | 108 || Token::IsEqualityOperator(kind_) |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 if (result.IsError() || result.IsNull()) { | 434 if (result.IsError() || result.IsNull()) { |
435 // TODO(turnidge): We could get better error messages by returning | 435 // TODO(turnidge): We could get better error messages by returning |
436 // the Error object directly to the parser. This will involve | 436 // the Error object directly to the parser. This will involve |
437 // replumbing all of the EvalConstExpr methods. | 437 // replumbing all of the EvalConstExpr methods. |
438 return NULL; | 438 return NULL; |
439 } | 439 } |
440 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 440 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
441 } | 441 } |
442 | 442 |
443 } // namespace dart | 443 } // namespace dart |
OLD | NEW |