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

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

Issue 22580005: Implement IsNullCheck for CheckClassInstr. If input is nullable expected type, then check for null … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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
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 4101 matching lines...) Expand 10 before | Expand all | Expand 10 after
4112 comparison()->EmitBranchCode(compiler, this); 4112 comparison()->EmitBranchCode(compiler, this);
4113 } 4113 }
4114 4114
4115 4115
4116 LocationSummary* CheckClassInstr::MakeLocationSummary() const { 4116 LocationSummary* CheckClassInstr::MakeLocationSummary() const {
4117 const intptr_t kNumInputs = 1; 4117 const intptr_t kNumInputs = 1;
4118 const intptr_t kNumTemps = 0; 4118 const intptr_t kNumTemps = 0;
4119 LocationSummary* summary = 4119 LocationSummary* summary =
4120 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 4120 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
4121 summary->set_in(0, Location::RequiresRegister()); 4121 summary->set_in(0, Location::RequiresRegister());
4122 if (!null_check()) { 4122 if (!IsNullCheck()) {
4123 summary->AddTemp(Location::RequiresRegister()); 4123 summary->AddTemp(Location::RequiresRegister());
4124 } 4124 }
4125 return summary; 4125 return summary;
4126 } 4126 }
4127 4127
4128 4128
4129 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4129 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4130 if (null_check()) { 4130 if (IsNullCheck()) {
4131 Label* deopt = compiler->AddDeoptStub(deopt_id(), 4131 Label* deopt = compiler->AddDeoptStub(deopt_id(),
4132 kDeoptCheckClass); 4132 kDeoptCheckClass);
4133 const Immediate& raw_null = 4133 const Immediate& raw_null =
4134 Immediate(reinterpret_cast<intptr_t>(Object::null())); 4134 Immediate(reinterpret_cast<intptr_t>(Object::null()));
4135 __ cmpq(locs()->in(0).reg(), raw_null); 4135 __ cmpq(locs()->in(0).reg(), raw_null);
4136 __ j(EQUAL, deopt); 4136 __ j(EQUAL, deopt);
4137 return; 4137 return;
4138 } 4138 }
4139 4139
4140 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || 4140 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
4584 PcDescriptors::kOther, 4584 PcDescriptors::kOther,
4585 locs()); 4585 locs());
4586 __ Drop(2); // Discard type arguments and receiver. 4586 __ Drop(2); // Discard type arguments and receiver.
4587 } 4587 }
4588 4588
4589 } // namespace dart 4589 } // namespace dart
4590 4590
4591 #undef __ 4591 #undef __
4592 4592
4593 #endif // defined TARGET_ARCH_X64 4593 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698