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

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

Issue 154393003: Implement eager instantiation and canonicalization of type arguments at run (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 "vm/assembler.h" 5 #include "vm/assembler.h"
6 #include "vm/bigint_operations.h" 6 #include "vm/bigint_operations.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2740 const Class& empty_class = 2740 const Class& empty_class =
2741 Class::Handle(CreateDummyClass(class_name, script)); 2741 Class::Handle(CreateDummyClass(class_name, script));
2742 SubtypeTestCache& cache = SubtypeTestCache::Handle(SubtypeTestCache::New()); 2742 SubtypeTestCache& cache = SubtypeTestCache::Handle(SubtypeTestCache::New());
2743 EXPECT(!cache.IsNull()); 2743 EXPECT(!cache.IsNull());
2744 EXPECT_EQ(0, cache.NumberOfChecks()); 2744 EXPECT_EQ(0, cache.NumberOfChecks());
2745 const TypeArguments& targ_0 = TypeArguments::Handle(TypeArguments::New(2)); 2745 const TypeArguments& targ_0 = TypeArguments::Handle(TypeArguments::New(2));
2746 const TypeArguments& targ_1 = TypeArguments::Handle(TypeArguments::New(3)); 2746 const TypeArguments& targ_1 = TypeArguments::Handle(TypeArguments::New(3));
2747 cache.AddCheck(empty_class.id(), targ_0, targ_1, Bool::True()); 2747 cache.AddCheck(empty_class.id(), targ_0, targ_1, Bool::True());
2748 EXPECT_EQ(1, cache.NumberOfChecks()); 2748 EXPECT_EQ(1, cache.NumberOfChecks());
2749 intptr_t test_class_id = -1; 2749 intptr_t test_class_id = -1;
2750 AbstractTypeArguments& test_targ_0 = AbstractTypeArguments::Handle(); 2750 TypeArguments& test_targ_0 = TypeArguments::Handle();
2751 AbstractTypeArguments& test_targ_1 = AbstractTypeArguments::Handle(); 2751 TypeArguments& test_targ_1 = TypeArguments::Handle();
2752 Bool& test_result = Bool::Handle(); 2752 Bool& test_result = Bool::Handle();
2753 cache.GetCheck(0, &test_class_id, &test_targ_0, &test_targ_1, &test_result); 2753 cache.GetCheck(0, &test_class_id, &test_targ_0, &test_targ_1, &test_result);
2754 EXPECT_EQ(empty_class.id(), test_class_id); 2754 EXPECT_EQ(empty_class.id(), test_class_id);
2755 EXPECT_EQ(targ_0.raw(), test_targ_0.raw()); 2755 EXPECT_EQ(targ_0.raw(), test_targ_0.raw());
2756 EXPECT_EQ(targ_1.raw(), test_targ_1.raw()); 2756 EXPECT_EQ(targ_1.raw(), test_targ_1.raw());
2757 EXPECT_EQ(Bool::True().raw(), test_result.raw()); 2757 EXPECT_EQ(Bool::True().raw(), test_result.raw());
2758 } 2758 }
2759 2759
2760 2760
2761 TEST_CASE(FieldTests) { 2761 TEST_CASE(FieldTests) {
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3982 // Simple map. 3982 // Simple map.
3983 // 3983 //
3984 // TODO(turnidge): Consider showing something like: {1: 2, 2: 'otter'} 3984 // TODO(turnidge): Consider showing something like: {1: 2, 2: 'otter'}
3985 result = Dart_GetField(lib, NewString("simple_map")); 3985 result = Dart_GetField(lib, NewString("simple_map"));
3986 EXPECT_VALID(result); 3986 EXPECT_VALID(result);
3987 obj ^= Api::UnwrapHandle(result); 3987 obj ^= Api::UnwrapHandle(result);
3988 EXPECT_STREQ("Instance of '_LinkedHashMap'", obj.ToUserCString()); 3988 EXPECT_STREQ("Instance of '_LinkedHashMap'", obj.ToUserCString());
3989 } 3989 }
3990 3990
3991 } // namespace dart 3991 } // namespace dart
OLDNEW
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698