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

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

Issue 22580005: Implement IsNullCheck for CheckClassInstr. If input is nullable expected type, then check for null … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/isolate.h" 10 #include "vm/isolate.h"
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 EXPECT_EQ(args_descriptor.raw(), o1.arguments_descriptor()); 2507 EXPECT_EQ(args_descriptor.raw(), o1.arguments_descriptor());
2508 2508
2509 const Function& target1 = Function::Handle(GetDummyTarget("Thun")); 2509 const Function& target1 = Function::Handle(GetDummyTarget("Thun"));
2510 o1.AddReceiverCheck(kSmiCid, target1); 2510 o1.AddReceiverCheck(kSmiCid, target1);
2511 EXPECT_EQ(1, o1.NumberOfChecks()); 2511 EXPECT_EQ(1, o1.NumberOfChecks());
2512 intptr_t test_class_id = -1; 2512 intptr_t test_class_id = -1;
2513 Function& test_target = Function::Handle(); 2513 Function& test_target = Function::Handle();
2514 o1.GetOneClassCheckAt(0, &test_class_id, &test_target); 2514 o1.GetOneClassCheckAt(0, &test_class_id, &test_target);
2515 EXPECT_EQ(kSmiCid, test_class_id); 2515 EXPECT_EQ(kSmiCid, test_class_id);
2516 EXPECT_EQ(target1.raw(), test_target.raw()); 2516 EXPECT_EQ(target1.raw(), test_target.raw());
2517 EXPECT_EQ(kSmiCid, o1.GetCidAt(0));
2517 GrowableArray<intptr_t> test_class_ids; 2518 GrowableArray<intptr_t> test_class_ids;
2518 o1.GetCheckAt(0, &test_class_ids, &test_target); 2519 o1.GetCheckAt(0, &test_class_ids, &test_target);
2519 EXPECT_EQ(1, test_class_ids.length()); 2520 EXPECT_EQ(1, test_class_ids.length());
2520 EXPECT_EQ(kSmiCid, test_class_ids[0]); 2521 EXPECT_EQ(kSmiCid, test_class_ids[0]);
2521 EXPECT_EQ(target1.raw(), test_target.raw()); 2522 EXPECT_EQ(target1.raw(), test_target.raw());
2522 2523
2523 const Function& target2 = Function::Handle(GetDummyTarget("Thun")); 2524 const Function& target2 = Function::Handle(GetDummyTarget("Thun"));
2524 o1.AddReceiverCheck(kDoubleCid, target2); 2525 o1.AddReceiverCheck(kDoubleCid, target2);
2525 EXPECT_EQ(2, o1.NumberOfChecks()); 2526 EXPECT_EQ(2, o1.NumberOfChecks());
2526 o1.GetOneClassCheckAt(1, &test_class_id, &test_target); 2527 o1.GetOneClassCheckAt(1, &test_class_id, &test_target);
2527 EXPECT_EQ(kDoubleCid, test_class_id); 2528 EXPECT_EQ(kDoubleCid, test_class_id);
2528 EXPECT_EQ(target2.raw(), test_target.raw()); 2529 EXPECT_EQ(target2.raw(), test_target.raw());
2530 EXPECT_EQ(kDoubleCid, o1.GetCidAt(1));
2529 2531
2530 ICData& o2 = ICData::Handle(); 2532 ICData& o2 = ICData::Handle();
2531 o2 = ICData::New(function, target_name, args_descriptor, 57, 2); 2533 o2 = ICData::New(function, target_name, args_descriptor, 57, 2);
2532 EXPECT_EQ(2, o2.num_args_tested()); 2534 EXPECT_EQ(2, o2.num_args_tested());
2533 EXPECT_EQ(57, o2.deopt_id()); 2535 EXPECT_EQ(57, o2.deopt_id());
2534 EXPECT_EQ(function.raw(), o2.function()); 2536 EXPECT_EQ(function.raw(), o2.function());
2535 EXPECT_EQ(0, o2.NumberOfChecks()); 2537 EXPECT_EQ(0, o2.NumberOfChecks());
2536 GrowableArray<intptr_t> classes; 2538 GrowableArray<intptr_t> classes;
2537 classes.Add(kSmiCid); 2539 classes.Add(kSmiCid);
2538 classes.Add(kSmiCid); 2540 classes.Add(kSmiCid);
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); 3365 const Function& test7 = Function::Handle(GetFunction(class_a, "test7"));
3364 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); 3366 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint());
3365 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); 3367 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint());
3366 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); 3368 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint());
3367 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); 3369 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint());
3368 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); 3370 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint());
3369 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); 3371 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
3370 } 3372 }
3371 3373
3372 } // namespace dart 3374 } // namespace dart
OLDNEW
« runtime/vm/intermediate_language_ia32.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698