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

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

Issue 10659005: Implement type cast in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return new LiteralNode(this->token_pos(), double_instance); 100 return new LiteralNode(this->token_pos(), double_instance);
101 } 101 }
102 } 102 }
103 return NULL; 103 return NULL;
104 } 104 }
105 105
106 106
107 bool ComparisonNode::IsKindValid() const { 107 bool ComparisonNode::IsKindValid() const {
108 return Token::IsRelationalOperator(kind_) 108 return Token::IsRelationalOperator(kind_)
109 || Token::IsEqualityOperator(kind_) 109 || Token::IsEqualityOperator(kind_)
110 || Token::IsInstanceofOperator(kind_); 110 || Token::IsTypeTestOperator(kind_)
111 || Token::IsTypeCastOperator(kind_);
111 } 112 }
112 113
113 114
114 const char* ComparisonNode::Name() const { 115 const char* ComparisonNode::Name() const {
115 return Token::Str(kind_); 116 return Token::Str(kind_);
116 } 117 }
117 118
118 119
119 const Instance* ComparisonNode::EvalConstExpr() const { 120 const Instance* ComparisonNode::EvalConstExpr() const {
120 const Instance* left_val = this->left()->EvalConstExpr(); 121 const Instance* left_val = this->left()->EvalConstExpr();
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 // the Error object directly to the parser. This will involve 375 // the Error object directly to the parser. This will involve
375 // replumbing all of the EvalConstExpr methods. 376 // replumbing all of the EvalConstExpr methods.
376 return NULL; 377 return NULL;
377 } 378 }
378 Instance& field_value = Instance::ZoneHandle(); 379 Instance& field_value = Instance::ZoneHandle();
379 field_value ^= result.raw(); 380 field_value ^= result.raw();
380 return &field_value; 381 return &field_value;
381 } 382 }
382 383
383 } // namespace dart 384 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698