| 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 "vm/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 Append(for_effect); | 795 Append(for_effect); |
| 796 if (!is_open()) return; | 796 if (!is_open()) return; |
| 797 } | 797 } |
| 798 | 798 |
| 799 Value* return_value = for_value.value(); | 799 Value* return_value = for_value.value(); |
| 800 if (FLAG_enable_type_checks) { | 800 if (FLAG_enable_type_checks) { |
| 801 const Function& function = owner()->parsed_function()->function(); | 801 const Function& function = owner()->parsed_function()->function(); |
| 802 const bool is_implicit_dynamic_getter = | 802 const bool is_implicit_dynamic_getter = |
| 803 (!function.is_static() && | 803 (!function.is_static() && |
| 804 ((function.kind() == RawFunction::kImplicitGetter) || | 804 ((function.kind() == RawFunction::kImplicitGetter) || |
| 805 (function.kind() == RawFunction::kConstImplicitGetter))); | 805 (function.kind() == RawFunction::kImplicitStaticFinalGetter))); |
| 806 // Implicit getters do not need a type check at return, unless they compute | 806 // Implicit getters do not need a type check at return, unless they compute |
| 807 // the initial value of a static field. | 807 // the initial value of a static field. |
| 808 // The body of a constructor cannot modify the type of the | 808 // The body of a constructor cannot modify the type of the |
| 809 // constructed instance, which is passed in as an implicit parameter. | 809 // constructed instance, which is passed in as an implicit parameter. |
| 810 // However, factories may create an instance of the wrong type. | 810 // However, factories may create an instance of the wrong type. |
| 811 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { | 811 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { |
| 812 const AbstractType& dst_type = | 812 const AbstractType& dst_type = |
| 813 AbstractType::ZoneHandle( | 813 AbstractType::ZoneHandle( |
| 814 owner()->parsed_function()->function().result_type()); | 814 owner()->parsed_function()->function().result_type()); |
| 815 return_value = BuildAssignableValue(node->value()->token_pos(), | 815 return_value = BuildAssignableValue(node->value()->token_pos(), |
| (...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3546 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3546 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3547 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3547 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3548 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3548 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3549 const Error& error = Error::Handle( | 3549 const Error& error = Error::Handle( |
| 3550 LanguageError::New(String::Handle(String::New(chars)))); | 3550 LanguageError::New(String::Handle(String::New(chars)))); |
| 3551 Isolate::Current()->long_jump_base()->Jump(1, error); | 3551 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3552 } | 3552 } |
| 3553 | 3553 |
| 3554 | 3554 |
| 3555 } // namespace dart | 3555 } // namespace dart |
| OLD | NEW |