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

Side by Side Diff: runtime/vm/intermediate_language_x64.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_mips.cc ('k') | no next file » | 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 5485 matching lines...) Expand 10 before | Expand all | Expand 10 after
5496 } 5496 }
5497 5497
5498 5498
5499 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5499 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5500 Label* deopt = compiler->AddDeoptStub(deopt_id(), 5500 Label* deopt = compiler->AddDeoptStub(deopt_id(),
5501 ICData::kDeoptCheckClass, 5501 ICData::kDeoptCheckClass,
5502 licm_hoisted_ ? ICData::kHoisted : 0); 5502 licm_hoisted_ ? ICData::kHoisted : 0);
5503 if (IsNullCheck()) { 5503 if (IsNullCheck()) {
5504 __ CompareObject(locs()->in(0).reg(), 5504 __ CompareObject(locs()->in(0).reg(),
5505 Object::null_object(), PP); 5505 Object::null_object(), PP);
5506 __ j(EQUAL, deopt); 5506 Condition cond = DeoptIfNull() ? EQUAL : NOT_EQUAL;
5507 __ j(cond, deopt);
5507 return; 5508 return;
5508 } 5509 }
5509 5510
5510 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || 5511 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
5511 (unary_checks().NumberOfChecks() > 1)); 5512 (unary_checks().NumberOfChecks() > 1));
5512 Register value = locs()->in(0).reg(); 5513 Register value = locs()->in(0).reg();
5513 Register temp = locs()->temp(0).reg(); 5514 Register temp = locs()->temp(0).reg();
5514 Label is_ok; 5515 Label is_ok;
5515 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) { 5516 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) {
5516 __ testq(value, Immediate(kSmiTagMask)); 5517 __ testq(value, Immediate(kSmiTagMask));
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
6442 __ Drop(1); 6443 __ Drop(1);
6443 __ popq(result); 6444 __ popq(result);
6444 } 6445 }
6445 6446
6446 6447
6447 } // namespace dart 6448 } // namespace dart
6448 6449
6449 #undef __ 6450 #undef __
6450 6451
6451 #endif // defined TARGET_ARCH_X64 6452 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698