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 "platform/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 3914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3925 cls.SetFunctions(functions); | 3925 cls.SetFunctions(functions); |
3926 cls.Finalize(); | 3926 cls.Finalize(); |
3927 | 3927 |
3928 // Add invocation dispatcher. | 3928 // Add invocation dispatcher. |
3929 const String& invocation_dispatcher_name = | 3929 const String& invocation_dispatcher_name = |
3930 String::Handle(Symbols::New("myMethod")); | 3930 String::Handle(Symbols::New("myMethod")); |
3931 const Array& args_desc = Array::Handle(ArgumentsDescriptor::New(1)); | 3931 const Array& args_desc = Array::Handle(ArgumentsDescriptor::New(1)); |
3932 Function& invocation_dispatcher = Function::Handle(); | 3932 Function& invocation_dispatcher = Function::Handle(); |
3933 invocation_dispatcher ^= | 3933 invocation_dispatcher ^= |
3934 cls.GetInvocationDispatcher(invocation_dispatcher_name, args_desc, | 3934 cls.GetInvocationDispatcher(invocation_dispatcher_name, args_desc, |
3935 RawFunction::kNoSuchMethodDispatcher); | 3935 RawFunction::kNoSuchMethodDispatcher, |
| 3936 true /* create_if_absent */); |
3936 EXPECT(!invocation_dispatcher.IsNull()); | 3937 EXPECT(!invocation_dispatcher.IsNull()); |
3937 // Get index to function. | 3938 // Get index to function. |
3938 intptr_t invocation_dispatcher_index = | 3939 intptr_t invocation_dispatcher_index = |
3939 cls.FindInvocationDispatcherFunctionIndex(invocation_dispatcher); | 3940 cls.FindInvocationDispatcherFunctionIndex(invocation_dispatcher); |
3940 // Expect a valid index. | 3941 // Expect a valid index. |
3941 EXPECT_GE(invocation_dispatcher_index, 0); | 3942 EXPECT_GE(invocation_dispatcher_index, 0); |
3942 // Retrieve function through index. | 3943 // Retrieve function through index. |
3943 Function& invocation_dispatcher_from_index = Function::Handle(); | 3944 Function& invocation_dispatcher_from_index = Function::Handle(); |
3944 invocation_dispatcher_from_index ^= | 3945 invocation_dispatcher_from_index ^= |
3945 cls.InvocationDispatcherFunctionFromIndex(invocation_dispatcher_index); | 3946 cls.InvocationDispatcherFunctionFromIndex(invocation_dispatcher_index); |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4752 { | 4753 { |
4753 const String& empty = String::Handle(String::New("")); | 4754 const String& empty = String::Handle(String::New("")); |
4754 const String* data[3] = { &Symbols::FallThroughError(), | 4755 const String* data[3] = { &Symbols::FallThroughError(), |
4755 &empty, | 4756 &empty, |
4756 &Symbols::isPaused() }; | 4757 &Symbols::isPaused() }; |
4757 CheckConcatAll(data, 3); | 4758 CheckConcatAll(data, 3); |
4758 } | 4759 } |
4759 } | 4760 } |
4760 | 4761 |
4761 } // namespace dart | 4762 } // namespace dart |
OLD | NEW |