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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.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_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 667 (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
668 __ pushl(ECX); // Store instantiator. 668 __ pushl(ECX); // Store instantiator.
669 __ pushl(EDX); // Store instantiator type arguments. 669 __ pushl(EDX); // Store instantiator type arguments.
670 // A null object is always assignable and is returned as result. 670 // A null object is always assignable and is returned as result.
671 const Immediate& raw_null = 671 const Immediate& raw_null =
672 Immediate(reinterpret_cast<intptr_t>(Object::null())); 672 Immediate(reinterpret_cast<intptr_t>(Object::null()));
673 Label is_assignable, runtime_call; 673 Label is_assignable, runtime_call;
674 __ cmpl(EAX, raw_null); 674 __ cmpl(EAX, raw_null);
675 __ j(EQUAL, &is_assignable); 675 __ j(EQUAL, &is_assignable);
676 676
677 if (!FLAG_eliminate_type_checks) { 677 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) {
678 // If type checks are not eliminated during the graph building then 678 // If type checks are not eliminated during the graph building then
679 // a transition sentinel can be seen here. 679 // a transition sentinel can be seen here.
680 const Immediate& raw_transition_sentinel = 680 const Immediate& raw_transition_sentinel =
681 Immediate(reinterpret_cast<intptr_t>( 681 Immediate(reinterpret_cast<intptr_t>(
682 Object::transition_sentinel().raw())); 682 Object::transition_sentinel().raw()));
683 __ cmpl(EAX, raw_transition_sentinel); 683 __ cmpl(EAX, raw_transition_sentinel);
684 __ j(EQUAL, &is_assignable); 684 __ j(EQUAL, &is_assignable);
685 } 685 }
686 686
687 // Generate throw new TypeError() if the type is malformed. 687 // Generate throw new TypeError() if the type is malformed.
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1910 __ movups(reg, Address(ESP, 0)); 1910 __ movups(reg, Address(ESP, 0));
1911 __ addl(ESP, Immediate(kFpuRegisterSize)); 1911 __ addl(ESP, Immediate(kFpuRegisterSize));
1912 } 1912 }
1913 1913
1914 1914
1915 #undef __ 1915 #undef __
1916 1916
1917 } // namespace dart 1917 } // namespace dart
1918 1918
1919 #endif // defined TARGET_ARCH_IA32 1919 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/flow_graph_compiler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698