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

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

Issue 657613004: VM: Avoid repeated deoptimization on speculatively hoisted smi-checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 3293 matching lines...) Expand 10 before | Expand all | Expand 10 after
3304 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 3304 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
3305 summary->set_in(0, Location::RequiresRegister()); 3305 summary->set_in(0, Location::RequiresRegister());
3306 summary->set_in(1, Location::RequiresRegister()); 3306 summary->set_in(1, Location::RequiresRegister());
3307 if (need_temp) summary->set_temp(0, Location::RequiresRegister()); 3307 if (need_temp) summary->set_temp(0, Location::RequiresRegister());
3308 return summary; 3308 return summary;
3309 } 3309 }
3310 3310
3311 3311
3312 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 3312 void CheckEitherNonSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
3313 Label* deopt = compiler->AddDeoptStub(deopt_id(), 3313 Label* deopt = compiler->AddDeoptStub(deopt_id(),
3314 ICData::kDeoptBinaryDoubleOp); 3314 ICData::kDeoptBinaryDoubleOp,
3315 licm_hoisted_ ? ICData::kHoisted : 0);
3315 intptr_t left_cid = left()->Type()->ToCid(); 3316 intptr_t left_cid = left()->Type()->ToCid();
3316 intptr_t right_cid = right()->Type()->ToCid(); 3317 intptr_t right_cid = right()->Type()->ToCid();
3317 Register left = locs()->in(0).reg(); 3318 Register left = locs()->in(0).reg();
3318 Register right = locs()->in(1).reg(); 3319 Register right = locs()->in(1).reg();
3319 if (this->left()->definition() == this->right()->definition()) { 3320 if (this->left()->definition() == this->right()->definition()) {
3320 __ testl(left, Immediate(kSmiTagMask)); 3321 __ testl(left, Immediate(kSmiTagMask));
3321 } else if (left_cid == kSmiCid) { 3322 } else if (left_cid == kSmiCid) {
3322 __ testl(right, Immediate(kSmiTagMask)); 3323 __ testl(right, Immediate(kSmiTagMask));
3323 } else if (right_cid == kSmiCid) { 3324 } else if (right_cid == kSmiCid) {
3324 __ testl(left, Immediate(kSmiTagMask)); 3325 __ testl(left, Immediate(kSmiTagMask));
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
5536 const intptr_t kNumTemps = 0; 5537 const intptr_t kNumTemps = 0;
5537 LocationSummary* summary = new(isolate) LocationSummary( 5538 LocationSummary* summary = new(isolate) LocationSummary(
5538 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5539 isolate, kNumInputs, kNumTemps, LocationSummary::kNoCall);
5539 summary->set_in(0, Location::RequiresRegister()); 5540 summary->set_in(0, Location::RequiresRegister());
5540 return summary; 5541 return summary;
5541 } 5542 }
5542 5543
5543 5544
5544 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5545 void CheckSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5545 Register value = locs()->in(0).reg(); 5546 Register value = locs()->in(0).reg();
5546 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptCheckSmi); 5547 Label* deopt = compiler->AddDeoptStub(deopt_id(),
5548 ICData::kDeoptCheckSmi,
5549 licm_hoisted_ ? ICData::kHoisted : 0);
5547 __ testl(value, Immediate(kSmiTagMask)); 5550 __ testl(value, Immediate(kSmiTagMask));
5548 __ j(NOT_ZERO, deopt); 5551 __ j(NOT_ZERO, deopt);
5549 } 5552 }
5550 5553
5551 5554
5552 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Isolate* isolate, 5555 LocationSummary* CheckClassIdInstr::MakeLocationSummary(Isolate* isolate,
5553 bool opt) const { 5556 bool opt) const {
5554 const intptr_t kNumInputs = 1; 5557 const intptr_t kNumInputs = 1;
5555 const intptr_t kNumTemps = 0; 5558 const intptr_t kNumTemps = 0;
5556 LocationSummary* summary = new(isolate) LocationSummary( 5559 LocationSummary* summary = new(isolate) LocationSummary(
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
6781 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6784 __ movl(EDX, Immediate(kInvalidObjectPointer));
6782 __ movl(EDX, Immediate(kInvalidObjectPointer)); 6785 __ movl(EDX, Immediate(kInvalidObjectPointer));
6783 #endif 6786 #endif
6784 } 6787 }
6785 6788
6786 } // namespace dart 6789 } // namespace dart
6787 6790
6788 #undef __ 6791 #undef __
6789 6792
6790 #endif // defined TARGET_ARCH_IA32 6793 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698