| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 419 |
| 420 | 420 |
| 421 const Instance* StaticGetterNode::EvalConstExpr() const { | 421 const Instance* StaticGetterNode::EvalConstExpr() const { |
| 422 const String& getter_name = | 422 const String& getter_name = |
| 423 String::Handle(Field::GetterName(this->field_name())); | 423 String::Handle(Field::GetterName(this->field_name())); |
| 424 const Function& getter_func = | 424 const Function& getter_func = |
| 425 Function::Handle(this->cls().LookupStaticFunction(getter_name)); | 425 Function::Handle(this->cls().LookupStaticFunction(getter_name)); |
| 426 if (getter_func.IsNull() || !getter_func.is_const()) { | 426 if (getter_func.IsNull() || !getter_func.is_const()) { |
| 427 return NULL; | 427 return NULL; |
| 428 } | 428 } |
| 429 const Array& args = Array::Handle(Object::empty_array()); | 429 const Object& result = Object::Handle( |
| 430 const Object& result = Object::Handle(DartEntry::InvokeStatic(getter_func, | 430 DartEntry::InvokeStatic(getter_func, Object::empty_array())); |
| 431 args)); | |
| 432 if (result.IsError() || result.IsNull()) { | 431 if (result.IsError() || result.IsNull()) { |
| 433 // TODO(turnidge): We could get better error messages by returning | 432 // TODO(turnidge): We could get better error messages by returning |
| 434 // the Error object directly to the parser. This will involve | 433 // the Error object directly to the parser. This will involve |
| 435 // replumbing all of the EvalConstExpr methods. | 434 // replumbing all of the EvalConstExpr methods. |
| 436 return NULL; | 435 return NULL; |
| 437 } | 436 } |
| 438 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 437 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
| 439 } | 438 } |
| 440 | 439 |
| 441 } // namespace dart | 440 } // namespace dart |
| OLD | NEW |