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

Side by Side Diff: vm/ast.cc

Issue 11648006: Create read only handles for empty_array and sentinel objects (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | « lib/string.cc ('k') | vm/class_finalizer_test.cc » ('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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « lib/string.cc ('k') | vm/class_finalizer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698