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

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

Issue 10823292: References to static functions are CT constants (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « runtime/vm/ast.h ('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 #include "vm/resolver.h" 10 #include "vm/resolver.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 case Token::kNOT: 277 case Token::kNOT:
278 return val->IsBool() ? val : NULL; 278 return val->IsBool() ? val : NULL;
279 case Token::kBIT_NOT: 279 case Token::kBIT_NOT:
280 return val->IsInteger() ? val : NULL; 280 return val->IsInteger() ? val : NULL;
281 default: 281 default:
282 return NULL; 282 return NULL;
283 } 283 }
284 } 284 }
285 285
286 286
287 const Instance* ClosureNode::EvalConstExpr() const {
288 if (function().IsImplicitStaticClosureFunction()) {
289 // Return a value that represents a closure. Only the type is relevant.
290 return &Closure::Handle();
291 }
292 return NULL;
293 }
294
295
287 const char* UnaryOpNode::Name() const { 296 const char* UnaryOpNode::Name() const {
288 return Token::Str(kind_); 297 return Token::Str(kind_);
289 } 298 }
290 299
291 300
292 const char* JumpNode::Name() const { 301 const char* JumpNode::Name() const {
293 return Token::Str(kind_); 302 return Token::Str(kind_);
294 } 303 }
295 304
296 305
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (result.IsError() || result.IsNull()) { 404 if (result.IsError() || result.IsNull()) {
396 // TODO(turnidge): We could get better error messages by returning 405 // TODO(turnidge): We could get better error messages by returning
397 // the Error object directly to the parser. This will involve 406 // the Error object directly to the parser. This will involve
398 // replumbing all of the EvalConstExpr methods. 407 // replumbing all of the EvalConstExpr methods.
399 return NULL; 408 return NULL;
400 } 409 }
401 return &Instance::ZoneHandle(Instance::Cast(result).raw()); 410 return &Instance::ZoneHandle(Instance::Cast(result).raw());
402 } 411 }
403 412
404 } // namespace dart 413 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/ast.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698