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

Side by Side Diff: runtime/lib/mirrors.cc

Issue 1722733002: In background compilation make a copy of Field in order to freeze its state (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: s Created 4 years, 10 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
« no previous file with comments | « no previous file | runtime/vm/assembler_arm.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/mirrors.h" 5 #include "lib/mirrors.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/bootstrap_natives.h" 8 #include "vm/bootstrap_natives.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 Function::Handle(getter.ImplicitClosureFunction()); 682 Function::Handle(getter.ImplicitClosureFunction());
683 return closure_function.ImplicitStaticClosure(); 683 return closure_function.ImplicitStaticClosure();
684 } 684 }
685 } 685 }
686 } else { 686 } else {
687 if (!field.IsUninitialized()) { 687 if (!field.IsUninitialized()) {
688 return field.StaticValue(); 688 return field.StaticValue();
689 } 689 }
690 // An uninitialized field was found. Check for a getter in the field's 690 // An uninitialized field was found. Check for a getter in the field's
691 // owner classs. 691 // owner classs.
692 const Class& klass = Class::Handle(field.owner()); 692 const Class& klass = Class::Handle(field.Owner());
693 const String& internal_getter_name = 693 const String& internal_getter_name =
694 String::Handle(Field::GetterName(getter_name)); 694 String::Handle(Field::GetterName(getter_name));
695 getter = klass.LookupStaticFunction(internal_getter_name); 695 getter = klass.LookupStaticFunction(internal_getter_name);
696 } 696 }
697 697
698 if (!getter.IsNull() && getter.is_reflectable()) { 698 if (!getter.IsNull() && getter.is_reflectable()) {
699 // Invoke the getter and return the result. 699 // Invoke the getter and return the result.
700 const Object& result = Object::Handle( 700 const Object& result = Object::Handle(
701 DartEntry::InvokeFunction(getter, Object::empty_array())); 701 DartEntry::InvokeFunction(getter, Object::empty_array()));
702 return ReturnResult(result); 702 return ReturnResult(result);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 Class& klass = Class::Handle(); 876 Class& klass = Class::Handle();
877 Library& library = Library::Handle(); 877 Library& library = Library::Handle();
878 878
879 if (decl.IsClass()) { 879 if (decl.IsClass()) {
880 klass ^= decl.raw(); 880 klass ^= decl.raw();
881 library = klass.library(); 881 library = klass.library();
882 } else if (decl.IsFunction()) { 882 } else if (decl.IsFunction()) {
883 klass = Function::Cast(decl).origin(); 883 klass = Function::Cast(decl).origin();
884 library = klass.library(); 884 library = klass.library();
885 } else if (decl.IsField()) { 885 } else if (decl.IsField()) {
886 klass = Field::Cast(decl).origin(); 886 klass = Field::Cast(decl).Origin();
887 library = klass.library(); 887 library = klass.library();
888 } else if (decl.IsLibrary()) { 888 } else if (decl.IsLibrary()) {
889 library ^= decl.raw(); 889 library ^= decl.raw();
890 } else if (decl.IsTypeParameter()) { 890 } else if (decl.IsTypeParameter()) {
891 klass ^= TypeParameter::Cast(decl).parameterized_class(); 891 klass ^= TypeParameter::Cast(decl).parameterized_class();
892 library = klass.library(); 892 library = klass.library();
893 } else { 893 } else {
894 return Object::empty_array().raw(); 894 return Object::empty_array().raw();
895 } 895 }
896 896
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 if (cls.is_synthesized_class() && 1986 if (cls.is_synthesized_class() &&
1987 !is_typedef && 1987 !is_typedef &&
1988 !cls.is_mixin_app_alias() && 1988 !cls.is_mixin_app_alias() &&
1989 !cls.is_enum_class()) { 1989 !cls.is_enum_class()) {
1990 return Instance::null(); // Synthetic. 1990 return Instance::null(); // Synthetic.
1991 } 1991 }
1992 script = cls.script(); 1992 script = cls.script();
1993 token_pos = cls.token_pos(); 1993 token_pos = cls.token_pos();
1994 } else if (decl.IsField()) { 1994 } else if (decl.IsField()) {
1995 const Field& field = Field::Cast(decl); 1995 const Field& field = Field::Cast(decl);
1996 script = field.script(); 1996 script = field.Script();
1997 token_pos = field.token_pos(); 1997 token_pos = field.token_pos();
1998 } else if (decl.IsTypeParameter()) { 1998 } else if (decl.IsTypeParameter()) {
1999 const TypeParameter& type_var = TypeParameter::Cast(decl); 1999 const TypeParameter& type_var = TypeParameter::Cast(decl);
2000 const Class& owner = Class::Handle(type_var.parameterized_class()); 2000 const Class& owner = Class::Handle(type_var.parameterized_class());
2001 script = owner.script(); 2001 script = owner.script();
2002 token_pos = type_var.token_pos(); 2002 token_pos = type_var.token_pos();
2003 } else if (decl.IsLibrary()) { 2003 } else if (decl.IsLibrary()) {
2004 const Library& lib = Library::Cast(decl); 2004 const Library& lib = Library::Cast(decl);
2005 if (lib.raw() == Library::NativeWrappersLibrary()) { 2005 if (lib.raw() == Library::NativeWrappersLibrary()) {
2006 return Instance::null(); // No source. 2006 return Instance::null(); // No source.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 2086
2087 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { 2087 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) {
2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); 2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); 2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
2090 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); 2090 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw();
2091 } 2091 }
2092 2092
2093 #endif // !PRODUCT 2093 #endif // !PRODUCT
2094 2094
2095 } // namespace dart 2095 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698