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

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

Issue 18147021: Fix type check elimination bug in code generator (issue 11792). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | tests/language/malformed_type_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 663 (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
664 __ pushq(RCX); // Store instantiator. 664 __ pushq(RCX); // Store instantiator.
665 __ pushq(RDX); // Store instantiator type arguments. 665 __ pushq(RDX); // Store instantiator type arguments.
666 // A null object is always assignable and is returned as result. 666 // A null object is always assignable and is returned as result.
667 const Immediate& raw_null = 667 const Immediate& raw_null =
668 Immediate(reinterpret_cast<intptr_t>(Object::null())); 668 Immediate(reinterpret_cast<intptr_t>(Object::null()));
669 Label is_assignable, runtime_call; 669 Label is_assignable, runtime_call;
670 __ cmpq(RAX, raw_null); 670 __ cmpq(RAX, raw_null);
671 __ j(EQUAL, &is_assignable); 671 __ j(EQUAL, &is_assignable);
672 672
673 if (!FLAG_eliminate_type_checks) { 673 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) {
674 // If type checks are not eliminated during the graph building then 674 // If type checks are not eliminated during the graph building then
675 // a transition sentinel can be seen here. 675 // a transition sentinel can be seen here.
676 __ CompareObject(RAX, Object::transition_sentinel()); 676 __ CompareObject(RAX, Object::transition_sentinel());
677 __ j(EQUAL, &is_assignable); 677 __ j(EQUAL, &is_assignable);
678 } 678 }
679 679
680 // Generate throw new TypeError() if the type is malformed. 680 // Generate throw new TypeError() if the type is malformed.
681 if (dst_type.IsMalformed()) { 681 if (dst_type.IsMalformed()) {
682 const Error& error = Error::Handle(dst_type.malformed_error()); 682 const Error& error = Error::Handle(dst_type.malformed_error());
683 const String& error_message = String::ZoneHandle( 683 const String& error_message = String::ZoneHandle(
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 __ movups(reg, Address(RSP, 0)); 1889 __ movups(reg, Address(RSP, 0));
1890 __ addq(RSP, Immediate(kFpuRegisterSize)); 1890 __ addq(RSP, Immediate(kFpuRegisterSize));
1891 } 1891 }
1892 1892
1893 1893
1894 #undef __ 1894 #undef __
1895 1895
1896 } // namespace dart 1896 } // namespace dart
1897 1897
1898 #endif // defined TARGET_ARCH_X64 1898 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_mips.cc ('k') | tests/language/malformed_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698