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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_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 3405 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 comparison()->EmitBranchCode(compiler, this); 3416 comparison()->EmitBranchCode(compiler, this);
3417 } 3417 }
3418 3418
3419 3419
3420 LocationSummary* CheckClassInstr::MakeLocationSummary() const { 3420 LocationSummary* CheckClassInstr::MakeLocationSummary() const {
3421 const intptr_t kNumInputs = 1; 3421 const intptr_t kNumInputs = 1;
3422 const intptr_t kNumTemps = 0; 3422 const intptr_t kNumTemps = 0;
3423 LocationSummary* summary = 3423 LocationSummary* summary =
3424 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); 3424 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall);
3425 summary->set_in(0, Location::RequiresRegister()); 3425 summary->set_in(0, Location::RequiresRegister());
3426 if (!null_check()) { 3426 if (!IsNullCheck()) {
3427 summary->AddTemp(Location::RequiresRegister()); 3427 summary->AddTemp(Location::RequiresRegister());
3428 } 3428 }
3429 return summary; 3429 return summary;
3430 } 3430 }
3431 3431
3432 3432
3433 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3433 void CheckClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3434 if (null_check()) { 3434 if (IsNullCheck()) {
3435 Label* deopt = compiler->AddDeoptStub(deopt_id(), 3435 Label* deopt = compiler->AddDeoptStub(deopt_id(),
3436 kDeoptCheckClass); 3436 kDeoptCheckClass);
3437 __ BranchEqual(locs()->in(0).reg(), 3437 __ BranchEqual(locs()->in(0).reg(),
3438 reinterpret_cast<int32_t>(Object::null()), deopt); 3438 reinterpret_cast<int32_t>(Object::null()), deopt);
3439 return; 3439 return;
3440 } 3440 }
3441 3441
3442 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) || 3442 ASSERT((unary_checks().GetReceiverClassIdAt(0) != kSmiCid) ||
3443 (unary_checks().NumberOfChecks() > 1)); 3443 (unary_checks().NumberOfChecks() > 1));
3444 Register value = locs()->in(0).reg(); 3444 Register value = locs()->in(0).reg();
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
3880 compiler->GenerateCall(token_pos(), 3880 compiler->GenerateCall(token_pos(),
3881 &label, 3881 &label,
3882 PcDescriptors::kOther, 3882 PcDescriptors::kOther,
3883 locs()); 3883 locs());
3884 __ Drop(2); // Discard type arguments and receiver. 3884 __ Drop(2); // Discard type arguments and receiver.
3885 } 3885 }
3886 3886
3887 } // namespace dart 3887 } // namespace dart
3888 3888
3889 #endif // defined TARGET_ARCH_MIPS 3889 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698