| OLD | NEW |
| 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 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 Object& result = Object::Handle( | 1600 Object& result = Object::Handle( |
| 1601 DartEntry::InvokeFunction(setter, args)); | 1601 DartEntry::InvokeFunction(setter, args)); |
| 1602 if (result.IsError()) { | 1602 if (result.IsError()) { |
| 1603 Exceptions::PropagateError(Error::Cast(result)); | 1603 Exceptions::PropagateError(Error::Cast(result)); |
| 1604 UNREACHABLE(); | 1604 UNREACHABLE(); |
| 1605 } | 1605 } |
| 1606 return result.raw(); | 1606 return result.raw(); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 if (field.is_final() || !field.is_reflectable()) { | 1609 if (field.is_final() || !field.is_reflectable()) { |
| 1610 const int kNumArgs = 1; |
| 1611 const Array& args = Array::Handle(Array::New(kNumArgs)); |
| 1612 args.SetAt(0, value); |
| 1613 |
| 1610 ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()), | 1614 ThrowNoSuchMethod(AbstractType::Handle(klass.RareType()), |
| 1611 internal_setter_name, | 1615 internal_setter_name, |
| 1612 setter, | 1616 setter, |
| 1613 Object::null_array(), | 1617 args, |
| 1614 Object::null_array(), | 1618 Object::null_array(), |
| 1615 InvocationMirror::kStatic, | 1619 InvocationMirror::kStatic, |
| 1616 InvocationMirror::kSetter); | 1620 InvocationMirror::kSetter); |
| 1617 UNREACHABLE(); | 1621 UNREACHABLE(); |
| 1618 } | 1622 } |
| 1619 | 1623 |
| 1620 field.SetStaticValue(value); | 1624 field.SetStaticValue(value); |
| 1621 return value.raw(); | 1625 return value.raw(); |
| 1622 } | 1626 } |
| 1623 | 1627 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 const Object& result = Object::Handle( | 1905 const Object& result = Object::Handle( |
| 1902 DartEntry::InvokeFunction(setter, args)); | 1906 DartEntry::InvokeFunction(setter, args)); |
| 1903 if (result.IsError()) { | 1907 if (result.IsError()) { |
| 1904 Exceptions::PropagateError(Error::Cast(result)); | 1908 Exceptions::PropagateError(Error::Cast(result)); |
| 1905 UNREACHABLE(); | 1909 UNREACHABLE(); |
| 1906 } | 1910 } |
| 1907 return result.raw(); | 1911 return result.raw(); |
| 1908 } | 1912 } |
| 1909 | 1913 |
| 1910 if (field.is_final() || !field.is_reflectable()) { | 1914 if (field.is_final() || !field.is_reflectable()) { |
| 1915 const int kNumArgs = 1; |
| 1916 const Array& args = Array::Handle(Array::New(kNumArgs)); |
| 1917 args.SetAt(0, value); |
| 1918 |
| 1911 ThrowNoSuchMethod(Instance::null_instance(), | 1919 ThrowNoSuchMethod(Instance::null_instance(), |
| 1912 internal_setter_name, | 1920 internal_setter_name, |
| 1913 setter, | 1921 setter, |
| 1914 Object::null_array(), | 1922 args, |
| 1915 Object::null_array(), | 1923 Object::null_array(), |
| 1916 InvocationMirror::kTopLevel, | 1924 InvocationMirror::kTopLevel, |
| 1917 InvocationMirror::kSetter); | 1925 InvocationMirror::kSetter); |
| 1918 UNREACHABLE(); | 1926 UNREACHABLE(); |
| 1919 } | 1927 } |
| 1920 | 1928 |
| 1921 field.SetStaticValue(value); | 1929 field.SetStaticValue(value); |
| 1922 return value.raw(); | 1930 return value.raw(); |
| 1923 } | 1931 } |
| 1924 | 1932 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2097 | 2105 |
| 2098 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2106 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
| 2099 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2107 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 2100 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2108 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 2101 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2109 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
| 2102 } | 2110 } |
| 2103 | 2111 |
| 2104 #endif // !PRODUCT | 2112 #endif // !PRODUCT |
| 2105 | 2113 |
| 2106 } // namespace dart | 2114 } // namespace dart |
| OLD | NEW |