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

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

Issue 300763002: Don't require eliminating certain type checks in unoptimized compilation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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_builder.cc ('k') | runtime/vm/flow_graph_compiler_arm64.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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 10 matching lines...) Expand all
21 #include "vm/symbols.h" 21 #include "vm/symbols.h"
22 22
23 namespace dart { 23 namespace dart {
24 24
25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); 25 DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization.");
26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); 26 DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic.");
27 DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic."); 27 DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic.");
28 DECLARE_FLAG(int, optimization_counter_threshold); 28 DECLARE_FLAG(int, optimization_counter_threshold);
29 DECLARE_FLAG(int, reoptimization_counter_threshold); 29 DECLARE_FLAG(int, reoptimization_counter_threshold);
30 DECLARE_FLAG(bool, enable_type_checks); 30 DECLARE_FLAG(bool, enable_type_checks);
31 DECLARE_FLAG(bool, eliminate_type_checks);
32 DECLARE_FLAG(bool, enable_simd_inline); 31 DECLARE_FLAG(bool, enable_simd_inline);
33 32
34 33
35 FlowGraphCompiler::~FlowGraphCompiler() { 34 FlowGraphCompiler::~FlowGraphCompiler() {
36 // BlockInfos are zone-allocated, so their destructors are not called. 35 // BlockInfos are zone-allocated, so their destructors are not called.
37 // Verify the labels explicitly here. 36 // Verify the labels explicitly here.
38 for (int i = 0; i < block_info_.length(); ++i) { 37 for (int i = 0; i < block_info_.length(); ++i) {
39 ASSERT(!block_info_[i]->jump_label()->IsLinked()); 38 ASSERT(!block_info_[i]->jump_label()->IsLinked());
40 } 39 }
41 } 40 }
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 // Assignable check is skipped in FlowGraphBuilder, not here. 650 // Assignable check is skipped in FlowGraphBuilder, not here.
652 ASSERT(dst_type.IsMalformedOrMalbounded() || 651 ASSERT(dst_type.IsMalformedOrMalbounded() ||
653 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); 652 (!dst_type.IsDynamicType() && !dst_type.IsObjectType()));
654 // Preserve instantiator (R2) and its type arguments (R1). 653 // Preserve instantiator (R2) and its type arguments (R1).
655 __ PushList((1 << R1) | (1 << R2)); 654 __ PushList((1 << R1) | (1 << R2));
656 // A null object is always assignable and is returned as result. 655 // A null object is always assignable and is returned as result.
657 Label is_assignable, runtime_call; 656 Label is_assignable, runtime_call;
658 __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null())); 657 __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null()));
659 __ b(&is_assignable, EQ); 658 __ b(&is_assignable, EQ);
660 659
661 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) {
662 // If type checks are not eliminated during the graph building then
663 // a transition sentinel can be seen here.
664 __ CompareObject(R0, Object::transition_sentinel());
665 __ b(&is_assignable, EQ);
666 }
667
668 // Generate throw new TypeError() if the type is malformed or malbounded. 660 // Generate throw new TypeError() if the type is malformed or malbounded.
669 if (dst_type.IsMalformedOrMalbounded()) { 661 if (dst_type.IsMalformedOrMalbounded()) {
670 __ PushObject(Object::ZoneHandle()); // Make room for the result. 662 __ PushObject(Object::ZoneHandle()); // Make room for the result.
671 __ Push(R0); // Push the source object. 663 __ Push(R0); // Push the source object.
672 __ PushObject(dst_name); // Push the name of the destination. 664 __ PushObject(dst_name); // Push the name of the destination.
673 __ PushObject(dst_type); // Push the type of the destination. 665 __ PushObject(dst_type); // Push the type of the destination.
674 GenerateRuntimeCall(token_pos, 666 GenerateRuntimeCall(token_pos,
675 deopt_id, 667 deopt_id,
676 kBadTypeErrorRuntimeEntry, 668 kBadTypeErrorRuntimeEntry,
677 3, 669 3,
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1783 DRegister dreg = EvenDRegisterOf(reg); 1775 DRegister dreg = EvenDRegisterOf(reg);
1784 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1776 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1785 } 1777 }
1786 1778
1787 1779
1788 #undef __ 1780 #undef __
1789 1781
1790 } // namespace dart 1782 } // namespace dart
1791 1783
1792 #endif // defined TARGET_ARCH_ARM 1784 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698