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/object.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/become.h" | 10 #include "vm/become.h" |
(...skipping 5987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5998 const Array& pair = Array::Handle(Array::New(2, Heap::kOld)); | 5998 const Array& pair = Array::Handle(Array::New(2, Heap::kOld)); |
5999 pair.SetAt(0, value); | 5999 pair.SetAt(0, value); |
6000 // pair[1] will be the implicit closure function if needed. | 6000 // pair[1] will be the implicit closure function if needed. |
6001 set_data(pair); | 6001 set_data(pair); |
6002 } | 6002 } |
6003 | 6003 |
6004 | 6004 |
6005 void Function::set_result_type(const AbstractType& value) const { | 6005 void Function::set_result_type(const AbstractType& value) const { |
6006 ASSERT(!value.IsNull()); | 6006 ASSERT(!value.IsNull()); |
6007 StorePointer(&raw_ptr()->result_type_, value.raw()); | 6007 StorePointer(&raw_ptr()->result_type_, value.raw()); |
6008 if (value.IsFunctionType() && !value.IsResolved()) { | 6008 if (value.IsFunctionType()) { |
6009 // The unresolved function result type may refer to this | 6009 // The function result type may refer to this function's type parameters. |
6010 // function's type parameters. Change its parent function. | 6010 // Change its parent function. |
6011 const Function& result_signature_function = | 6011 const Function& result_signature_function = |
6012 Function::Handle(Type::Cast(value).signature()); | 6012 Function::Handle(Type::Cast(value).signature()); |
6013 result_signature_function.set_parent_function(*this); | 6013 result_signature_function.set_parent_function(*this); |
6014 } | 6014 } |
6015 } | 6015 } |
6016 | 6016 |
6017 | 6017 |
6018 RawAbstractType* Function::ParameterTypeAt(intptr_t index) const { | 6018 RawAbstractType* Function::ParameterTypeAt(intptr_t index) const { |
6019 const Array& parameter_types = Array::Handle(raw_ptr()->parameter_types_); | 6019 const Array& parameter_types = Array::Handle(raw_ptr()->parameter_types_); |
6020 return AbstractType::RawCast(parameter_types.At(index)); | 6020 return AbstractType::RawCast(parameter_types.At(index)); |
(...skipping 17481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
23502 return UserTag::null(); | 23502 return UserTag::null(); |
23503 } | 23503 } |
23504 | 23504 |
23505 | 23505 |
23506 const char* UserTag::ToCString() const { | 23506 const char* UserTag::ToCString() const { |
23507 const String& tag_label = String::Handle(label()); | 23507 const String& tag_label = String::Handle(label()); |
23508 return tag_label.ToCString(); | 23508 return tag_label.ToCString(); |
23509 } | 23509 } |
23510 | 23510 |
23511 } // namespace dart | 23511 } // namespace dart |
OLD | NEW |