Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(652)

Side by Side Diff: runtime/vm/object_test.cc

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after
3014 TokenPosition::kMinSource); 3014 TokenPosition::kMinSource);
3015 } 3015 }
3016 3016
3017 3017
3018 ISOLATE_UNIT_TEST_CASE(ICData) { 3018 ISOLATE_UNIT_TEST_CASE(ICData) {
3019 Function& function = Function::Handle(GetDummyTarget("Bern")); 3019 Function& function = Function::Handle(GetDummyTarget("Bern"));
3020 const intptr_t id = 12; 3020 const intptr_t id = 12;
3021 const intptr_t num_args_tested = 1; 3021 const intptr_t num_args_tested = 1;
3022 const String& target_name = String::Handle(Symbols::New(thread, "Thun")); 3022 const String& target_name = String::Handle(Symbols::New(thread, "Thun"));
3023 const Array& args_descriptor = 3023 const Array& args_descriptor =
3024 Array::Handle(ArgumentsDescriptor::New(1, Object::null_array())); 3024 Array::Handle(ArgumentsDescriptor::New(0, 1, Object::null_array()));
3025 ICData& o1 = ICData::Handle(); 3025 ICData& o1 = ICData::Handle();
3026 o1 = ICData::New(function, target_name, args_descriptor, id, num_args_tested, 3026 o1 = ICData::New(function, target_name, args_descriptor, id, num_args_tested,
3027 false); 3027 false);
3028 EXPECT_EQ(1, o1.NumArgsTested()); 3028 EXPECT_EQ(1, o1.NumArgsTested());
3029 EXPECT_EQ(id, o1.deopt_id()); 3029 EXPECT_EQ(id, o1.deopt_id());
3030 EXPECT_EQ(function.raw(), o1.Owner()); 3030 EXPECT_EQ(function.raw(), o1.Owner());
3031 EXPECT_EQ(0, o1.NumberOfChecks()); 3031 EXPECT_EQ(0, o1.NumberOfChecks());
3032 EXPECT_EQ(target_name.raw(), o1.target_name()); 3032 EXPECT_EQ(target_name.raw(), o1.target_name());
3033 EXPECT_EQ(args_descriptor.raw(), o1.arguments_descriptor()); 3033 EXPECT_EQ(args_descriptor.raw(), o1.arguments_descriptor());
3034 3034
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
3835 parent = 3835 parent =
3836 Function::New(parent_name, RawFunction::kRegularFunction, false, false, 3836 Function::New(parent_name, RawFunction::kRegularFunction, false, false,
3837 false, false, false, cls, TokenPosition::kMinSource); 3837 false, false, false, cls, TokenPosition::kMinSource);
3838 functions.SetAt(0, parent); 3838 functions.SetAt(0, parent);
3839 cls.SetFunctions(functions); 3839 cls.SetFunctions(functions);
3840 cls.Finalize(); 3840 cls.Finalize();
3841 3841
3842 // Add invocation dispatcher. 3842 // Add invocation dispatcher.
3843 const String& invocation_dispatcher_name = 3843 const String& invocation_dispatcher_name =
3844 String::Handle(Symbols::New(thread, "myMethod")); 3844 String::Handle(Symbols::New(thread, "myMethod"));
3845 const Array& args_desc = Array::Handle(ArgumentsDescriptor::New(1)); 3845 const Array& args_desc = Array::Handle(ArgumentsDescriptor::New(0, 1));
3846 Function& invocation_dispatcher = Function::Handle(); 3846 Function& invocation_dispatcher = Function::Handle();
3847 invocation_dispatcher ^= cls.GetInvocationDispatcher( 3847 invocation_dispatcher ^= cls.GetInvocationDispatcher(
3848 invocation_dispatcher_name, args_desc, 3848 invocation_dispatcher_name, args_desc,
3849 RawFunction::kNoSuchMethodDispatcher, true /* create_if_absent */); 3849 RawFunction::kNoSuchMethodDispatcher, true /* create_if_absent */);
3850 EXPECT(!invocation_dispatcher.IsNull()); 3850 EXPECT(!invocation_dispatcher.IsNull());
3851 // Get index to function. 3851 // Get index to function.
3852 intptr_t invocation_dispatcher_index = 3852 intptr_t invocation_dispatcher_index =
3853 cls.FindInvocationDispatcherFunctionIndex(invocation_dispatcher); 3853 cls.FindInvocationDispatcherFunctionIndex(invocation_dispatcher);
3854 // Expect a valid index. 3854 // Expect a valid index.
3855 EXPECT_GE(invocation_dispatcher_index, 0); 3855 EXPECT_GE(invocation_dispatcher_index, 0);
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
4720 // utf32->utf16 conversion. 4720 // utf32->utf16 conversion.
4721 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, 4721 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff,
4722 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; 4722 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff};
4723 4723
4724 const String& str = 4724 const String& str =
4725 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); 4725 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes)));
4726 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); 4726 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes)));
4727 } 4727 }
4728 4728
4729 } // namespace dart 4729 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698