Chromium Code Reviews| 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 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2177 intptr_t token_pos) { | 2177 intptr_t token_pos) { |
| 2178 const Class& result = Class::Handle(New(name, script, token_pos)); | 2178 const Class& result = Class::Handle(New(name, script, token_pos)); |
| 2179 // Instances of a signature class can only be closures. | 2179 // Instances of a signature class can only be closures. |
| 2180 result.set_instance_size(Closure::InstanceSize()); | 2180 result.set_instance_size(Closure::InstanceSize()); |
| 2181 result.set_next_field_offset(Closure::InstanceSize()); | 2181 result.set_next_field_offset(Closure::InstanceSize()); |
| 2182 // Signature classes extend the _FunctionImpl class. | 2182 // Signature classes extend the _FunctionImpl class. |
| 2183 result.set_super_type(Type::Handle( | 2183 result.set_super_type(Type::Handle( |
| 2184 Isolate::Current()->object_store()->function_impl_type())); | 2184 Isolate::Current()->object_store()->function_impl_type())); |
| 2185 result.set_is_synthesized_class(); | 2185 result.set_is_synthesized_class(); |
| 2186 result.set_type_arguments_field_offset(Closure::type_arguments_offset()); | 2186 result.set_type_arguments_field_offset(Closure::type_arguments_offset()); |
| 2187 // Implements interface "Function". | |
|
Ivan Posva
2013/08/27 16:07:47
The interface Function is implemented as part of s
| |
| 2188 const Type& function_type = Type::Handle(Type::Function()); | |
| 2189 const Array& interfaces = Array::Handle(Array::New(1, Heap::kOld)); | |
| 2190 interfaces.SetAt(0, function_type); | |
| 2191 result.set_interfaces(interfaces); | |
| 2192 if (!signature_function.IsNull()) { | 2187 if (!signature_function.IsNull()) { |
| 2193 result.PatchSignatureFunction(signature_function); | 2188 result.PatchSignatureFunction(signature_function); |
| 2194 } | 2189 } |
| 2195 return result.raw(); | 2190 return result.raw(); |
| 2196 } | 2191 } |
| 2197 | 2192 |
| 2198 | 2193 |
| 2199 void Class::PatchSignatureFunction(const Function& signature_function) const { | 2194 void Class::PatchSignatureFunction(const Function& signature_function) const { |
| 2200 ASSERT(!signature_function.IsNull()); | 2195 ASSERT(!signature_function.IsNull()); |
| 2201 const Class& owner_class = Class::Handle(signature_function.Owner()); | 2196 const Class& owner_class = Class::Handle(signature_function.Owner()); |
| (...skipping 12650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14852 } | 14847 } |
| 14853 | 14848 |
| 14854 | 14849 |
| 14855 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 14850 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 14856 stream->OpenObject(); | 14851 stream->OpenObject(); |
| 14857 stream->CloseObject(); | 14852 stream->CloseObject(); |
| 14858 } | 14853 } |
| 14859 | 14854 |
| 14860 | 14855 |
| 14861 } // namespace dart | 14856 } // namespace dart |
| OLD | NEW |