| 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 "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
| 8 #include "vm/code_descriptors.h" | 8 #include "vm/code_descriptors.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 (function.kind() == RawFunction::kConstImplicitGetter))); | 501 (function.kind() == RawFunction::kConstImplicitGetter))); |
| 502 // Implicit getters do not need a type check at return, unless they compute | 502 // Implicit getters do not need a type check at return, unless they compute |
| 503 // the initial value of a static field. | 503 // the initial value of a static field. |
| 504 // The body of a constructor cannot modify the type of the | 504 // The body of a constructor cannot modify the type of the |
| 505 // constructed instance, which is passed in as an implicit parameter. | 505 // constructed instance, which is passed in as an implicit parameter. |
| 506 // However, factories may create an instance of the wrong type. | 506 // However, factories may create an instance of the wrong type. |
| 507 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { | 507 if (!is_implicit_dynamic_getter && !function.IsConstructor()) { |
| 508 const AbstractType& dst_type = | 508 const AbstractType& dst_type = |
| 509 AbstractType::ZoneHandle( | 509 AbstractType::ZoneHandle( |
| 510 owner()->parsed_function().function().result_type()); | 510 owner()->parsed_function().function().result_type()); |
| 511 const String& dst_name = | 511 const String& dst_name = String::ZoneHandle(Symbols::FunctionResult()); |
| 512 String::ZoneHandle(Symbols::New("function result")); | |
| 513 return_value = BuildAssignableValue(node->value()->token_pos(), | 512 return_value = BuildAssignableValue(node->value()->token_pos(), |
| 514 return_value, | 513 return_value, |
| 515 dst_type, | 514 dst_type, |
| 516 dst_name); | 515 dst_name); |
| 517 } | 516 } |
| 518 } | 517 } |
| 519 | 518 |
| 520 intptr_t current_context_level = owner()->context_level(); | 519 intptr_t current_context_level = owner()->context_level(); |
| 521 ASSERT(current_context_level >= 0); | 520 ASSERT(current_context_level >= 0); |
| 522 if (owner()->parsed_function().saved_context_var() != NULL) { | 521 if (owner()->parsed_function().saved_context_var() != NULL) { |
| (...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2962 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 2961 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 2963 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 2962 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 2964 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2963 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2965 const Error& error = Error::Handle( | 2964 const Error& error = Error::Handle( |
| 2966 LanguageError::New(String::Handle(String::New(chars)))); | 2965 LanguageError::New(String::Handle(String::New(chars)))); |
| 2967 Isolate::Current()->long_jump_base()->Jump(1, error); | 2966 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2968 } | 2967 } |
| 2969 | 2968 |
| 2970 | 2969 |
| 2971 } // namespace dart | 2970 } // namespace dart |
| OLD | NEW |