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

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

Issue 25898002: Skip AssertAssignable in code generator if optimizer could establish that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « no previous file | tests/co19/co19-runtime.status » ('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 "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 // Performance notes: positive checks must be quick, negative checks can be slow 656 // Performance notes: positive checks must be quick, negative checks can be slow
657 // as they throw an exception. 657 // as they throw an exception.
658 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, 658 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos,
659 intptr_t deopt_id, 659 intptr_t deopt_id,
660 const AbstractType& dst_type, 660 const AbstractType& dst_type,
661 const String& dst_name, 661 const String& dst_name,
662 LocationSummary* locs) { 662 LocationSummary* locs) {
663 ASSERT(token_pos >= 0); 663 ASSERT(token_pos >= 0);
664 ASSERT(!dst_type.IsNull()); 664 ASSERT(!dst_type.IsNull());
665 ASSERT(dst_type.IsFinalized()); 665 ASSERT(dst_type.IsFinalized());
666 // Assignable check is skipped in FlowGraphBuilder, not here. 666 // Assignable check is skipped in FlowGraphBuilder, when possible.
667 ASSERT(dst_type.IsMalformed() || dst_type.IsMalbounded() || 667 // The optimizer may have instantiated dst_type to dynamic or Object.
668 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 668 if (!dst_type.IsMalformed() && !dst_type.IsMalbounded() &&
669 (dst_type.IsDynamicType() || dst_type.IsObjectType())) {
670 return;
671 }
srdjan 2013/10/03 18:00:09 This elimination belongs in AssertAssignableInstr:
regis 2013/10/03 18:20:53 Done.
669 __ pushl(ECX); // Store instantiator. 672 __ pushl(ECX); // Store instantiator.
670 __ pushl(EDX); // Store instantiator type arguments. 673 __ pushl(EDX); // Store instantiator type arguments.
671 // A null object is always assignable and is returned as result. 674 // A null object is always assignable and is returned as result.
672 const Immediate& raw_null = 675 const Immediate& raw_null =
673 Immediate(reinterpret_cast<intptr_t>(Object::null())); 676 Immediate(reinterpret_cast<intptr_t>(Object::null()));
674 Label is_assignable, runtime_call; 677 Label is_assignable, runtime_call;
675 __ cmpl(EAX, raw_null); 678 __ cmpl(EAX, raw_null);
676 __ j(EQUAL, &is_assignable); 679 __ j(EQUAL, &is_assignable);
677 680
678 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) { 681 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) {
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 __ movups(reg, Address(ESP, 0)); 1918 __ movups(reg, Address(ESP, 0));
1916 __ addl(ESP, Immediate(kFpuRegisterSize)); 1919 __ addl(ESP, Immediate(kFpuRegisterSize));
1917 } 1920 }
1918 1921
1919 1922
1920 #undef __ 1923 #undef __
1921 1924
1922 } // namespace dart 1925 } // namespace dart
1923 1926
1924 #endif // defined TARGET_ARCH_IA32 1927 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698