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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4652 matching lines...) Expand 10 before | Expand all | Expand 10 after
4663 } 4663 }
4664 return summary; 4664 return summary;
4665 } 4665 }
4666 4666
4667 4667
4668 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4668 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4669 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4669 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4670 ICData::kDeoptCheckClass, 4670 ICData::kDeoptCheckClass,
4671 licm_hoisted_ ? ICData::kHoisted : 0); 4671 licm_hoisted_ ? ICData::kHoisted : 0);
4672 if (IsNullCheck()) { 4672 if (IsNullCheck()) {
4673 __ BranchEqual(locs()->in(0).reg(), Object::null_object(), deopt); 4673 if (DeoptIfNull()) {
4674 __ BranchEqual(locs()->in(0).reg(), Object::null_object(), deopt);
4675 } else {
4676 ASSERT(DeoptIfNotNull());
4677 __ BranchNotEqual(locs()->in(0).reg(), Object::null_object(), deopt);
4678 }
4674 return; 4679 return;
4675 } 4680 }
4676 4681
4677 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || 4682 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
4678 (unary_checks().NumberOfChecks() > 1)); 4683 (unary_checks().NumberOfChecks() > 1));
4679 Register value = locs()->in(0).reg(); 4684 Register value = locs()->in(0).reg();
4680 Register temp = locs()->temp(0).reg(); 4685 Register temp = locs()->temp(0).reg();
4681 Label is_ok; 4686 Label is_ok;
4682 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) { 4687 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) {
4683 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); 4688 __ andi(CMPRES1, value, Immediate(kSmiTagMask));
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5620 1, 5625 1,
5621 locs()); 5626 locs());
5622 __ lw(result, Address(SP, 1 * kWordSize)); 5627 __ lw(result, Address(SP, 1 * kWordSize));
5623 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5628 __ addiu(SP, SP, Immediate(2 * kWordSize));
5624 } 5629 }
5625 5630
5626 5631
5627 } // namespace dart 5632 } // namespace dart
5628 5633
5629 #endif // defined TARGET_ARCH_MIPS 5634 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698