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/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 4782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4793 ClassFinalizer::FinalizeType( | 4793 ClassFinalizer::FinalizeType( |
4794 signature_class, signature_type, ClassFinalizer::kCanonicalize); | 4794 signature_class, signature_type, ClassFinalizer::kCanonicalize); |
4795 } | 4795 } |
4796 ASSERT(closure_function.signature_class() == signature_class.raw()); | 4796 ASSERT(closure_function.signature_class() == signature_class.raw()); |
4797 set_implicit_closure_function(closure_function); | 4797 set_implicit_closure_function(closure_function); |
4798 ASSERT(closure_function.IsImplicitClosureFunction()); | 4798 ASSERT(closure_function.IsImplicitClosureFunction()); |
4799 return closure_function.raw(); | 4799 return closure_function.raw(); |
4800 } | 4800 } |
4801 | 4801 |
4802 | 4802 |
| 4803 RawInstance* Function::ImplicitStaticClosure() const { |
| 4804 Instance& closure = Instance::Handle(implicit_static_closure()); |
| 4805 if (closure.IsNull()) { |
| 4806 ObjectStore* object_store = Isolate::Current()->object_store(); |
| 4807 const Context& context = Context::Handle(object_store->empty_context()); |
| 4808 closure ^= Closure::New(*this, context, Heap::kOld); |
| 4809 set_implicit_static_closure(closure); |
| 4810 } |
| 4811 return closure.raw(); |
| 4812 } |
| 4813 |
| 4814 |
4803 RawString* Function::BuildSignature( | 4815 RawString* Function::BuildSignature( |
4804 bool instantiate, | 4816 bool instantiate, |
4805 NameVisibility name_visibility, | 4817 NameVisibility name_visibility, |
4806 const AbstractTypeArguments& instantiator) const { | 4818 const AbstractTypeArguments& instantiator) const { |
4807 const GrowableObjectArray& pieces = | 4819 const GrowableObjectArray& pieces = |
4808 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 4820 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
4809 String& name = String::Handle(); | 4821 String& name = String::Handle(); |
4810 if (!instantiate && !is_static() && (name_visibility == kInternalName)) { | 4822 if (!instantiate && !is_static() && (name_visibility == kInternalName)) { |
4811 // Prefix the signature with its signature class and type parameters, if any | 4823 // Prefix the signature with its signature class and type parameters, if any |
4812 // (e.g. "Map<K, V>(K) => bool"). In case of a function type alias, the | 4824 // (e.g. "Map<K, V>(K) => bool"). In case of a function type alias, the |
(...skipping 10098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14911 return "_MirrorReference"; | 14923 return "_MirrorReference"; |
14912 } | 14924 } |
14913 | 14925 |
14914 | 14926 |
14915 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14927 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
14916 JSONObject jsobj(stream); | 14928 JSONObject jsobj(stream); |
14917 } | 14929 } |
14918 | 14930 |
14919 | 14931 |
14920 } // namespace dart | 14932 } // namespace dart |
OLD | NEW |