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 GrowableArray<const Object*> arguments; | 429 const Array& args = Array::Handle(Object::empty_array()); |
430 const Array& kNoArgumentNames = Array::Handle(); | 430 const Object& result = Object::Handle(DartEntry::InvokeStatic(getter_func, |
431 const Object& result = | 431 args)); |
432 Object::Handle(DartEntry::InvokeStatic(getter_func, | |
433 arguments, | |
434 kNoArgumentNames)); | |
435 if (result.IsError() || result.IsNull()) { | 432 if (result.IsError() || result.IsNull()) { |
436 // TODO(turnidge): We could get better error messages by returning | 433 // TODO(turnidge): We could get better error messages by returning |
437 // the Error object directly to the parser. This will involve | 434 // the Error object directly to the parser. This will involve |
438 // replumbing all of the EvalConstExpr methods. | 435 // replumbing all of the EvalConstExpr methods. |
439 return NULL; | 436 return NULL; |
440 } | 437 } |
441 return &Instance::ZoneHandle(Instance::Cast(result).raw()); | 438 return &Instance::ZoneHandle(Instance::Cast(result).raw()); |
442 } | 439 } |
443 | 440 |
444 } // namespace dart | 441 } // namespace dart |
OLD | NEW |