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

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

Issue 1058793003: A CheckClass instruction that compares against a null class only can be optimized to check instance… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 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/intermediate_language.cc ('k') | runtime/vm/intermediate_language_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/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 5921 matching lines...) Expand 10 before | Expand all | Expand 10 after
5932 } 5932 }
5933 5933
5934 5934
5935 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5935 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5936 Label* deopt = compiler->AddDeoptStub(deopt_id(), 5936 Label* deopt = compiler->AddDeoptStub(deopt_id(),
5937 ICData::kDeoptCheckClass, 5937 ICData::kDeoptCheckClass,
5938 licm_hoisted_ ? ICData::kHoisted : 0); 5938 licm_hoisted_ ? ICData::kHoisted : 0);
5939 if (IsNullCheck()) { 5939 if (IsNullCheck()) {
5940 __ CompareImmediate(locs()->in(0).reg(), 5940 __ CompareImmediate(locs()->in(0).reg(),
5941 reinterpret_cast<intptr_t>(Object::null())); 5941 reinterpret_cast<intptr_t>(Object::null()));
5942 __ b(deopt, EQ); 5942 ASSERT(DeoptIfNull() || DeoptIfNotNull());
5943 Condition cond = DeoptIfNull() ? EQ : NE;
5944 __ b(deopt, cond);
5943 return; 5945 return;
5944 } 5946 }
5945 5947
5946 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || 5948 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
5947 (unary_checks().NumberOfChecks() > 1)); 5949 (unary_checks().NumberOfChecks() > 1));
5948 const Register value = locs()->in(0).reg(); 5950 const Register value = locs()->in(0).reg();
5949 const Register temp = locs()->temp(0).reg(); 5951 const Register temp = locs()->temp(0).reg();
5950 Label is_ok; 5952 Label is_ok;
5951 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) { 5953 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) {
5952 __ tst(value, Operand(kSmiTagMask)); 5954 __ tst(value, Operand(kSmiTagMask));
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
6878 1, 6880 1,
6879 locs()); 6881 locs());
6880 __ Drop(1); 6882 __ Drop(1);
6881 __ Pop(result); 6883 __ Pop(result);
6882 } 6884 }
6883 6885
6884 6886
6885 } // namespace dart 6887 } // namespace dart
6886 6888
6887 #endif // defined TARGET_ARCH_ARM 6889 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/intermediate_language_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698