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

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

Issue 676743002: IR cleanup: pass deopt id as constructor argument instead of doing deopt_id_ assignment. (Closed) Base URL: https://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
« 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 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
3124 const Register value = locs()->in(0).reg(); 3124 const Register value = locs()->in(0).reg();
3125 const DRegister result = locs()->out(0).fpu_reg(); 3125 const DRegister result = locs()->out(0).fpu_reg();
3126 3126
3127 if (value_cid == kDoubleCid) { 3127 if (value_cid == kDoubleCid) {
3128 __ LoadDFromOffset(result, value, Double::value_offset() - kHeapObjectTag); 3128 __ LoadDFromOffset(result, value, Double::value_offset() - kHeapObjectTag);
3129 } else if (value_cid == kSmiCid) { 3129 } else if (value_cid == kSmiCid) {
3130 __ SmiUntag(TMP, value); 3130 __ SmiUntag(TMP, value);
3131 __ mtc1(TMP, STMP1); 3131 __ mtc1(TMP, STMP1);
3132 __ cvtdw(result, STMP1); 3132 __ cvtdw(result, STMP1);
3133 } else { 3133 } else {
3134 Label* deopt = compiler->AddDeoptStub(deopt_id_, 3134 Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
3135 ICData::kDeoptBinaryDoubleOp); 3135 ICData::kDeoptBinaryDoubleOp);
3136 if (value_type->is_nullable() && 3136 if (value_type->is_nullable() &&
3137 (value_type->ToNullableCid() == kDoubleCid)) { 3137 (value_type->ToNullableCid() == kDoubleCid)) {
3138 __ BranchEqual(value, Object::null_object(), deopt); 3138 __ BranchEqual(value, Object::null_object(), deopt);
3139 // It must be double now. 3139 // It must be double now.
3140 __ LoadDFromOffset(result, value, 3140 __ LoadDFromOffset(result, value,
3141 Double::value_offset() - kHeapObjectTag); 3141 Double::value_offset() - kHeapObjectTag);
3142 } else { 3142 } else {
3143 Label is_smi, done; 3143 Label is_smi, done;
3144 3144
(...skipping 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
4668 __ BranchNotEqual(CMPRES1, CMPRES2, deopt); 4668 __ BranchNotEqual(CMPRES1, CMPRES2, deopt);
4669 } 4669 }
4670 } 4670 }
4671 4671
4672 4672
4673 void UnboxIntNInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 4673 void UnboxIntNInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
4674 const intptr_t value_cid = value()->Type()->ToCid(); 4674 const intptr_t value_cid = value()->Type()->ToCid();
4675 const Register value = locs()->in(0).reg(); 4675 const Register value = locs()->in(0).reg();
4676 const Register out = locs()->out(0).reg(); 4676 const Register out = locs()->out(0).reg();
4677 Label* deopt = CanDeoptimize() ? 4677 Label* deopt = CanDeoptimize() ?
4678 compiler->AddDeoptStub(deopt_id_, ICData::kDeoptUnboxInteger) : NULL; 4678 compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
4679 Label* out_of_range = !is_truncating() ? deopt : NULL; 4679 Label* out_of_range = !is_truncating() ? deopt : NULL;
4680 ASSERT(value != out); 4680 ASSERT(value != out);
4681 4681
4682 if (value_cid == kSmiCid) { 4682 if (value_cid == kSmiCid) {
4683 __ SmiUntag(out, value); 4683 __ SmiUntag(out, value);
4684 } else if (value_cid == kMintCid) { 4684 } else if (value_cid == kMintCid) {
4685 LoadInt32FromMint(compiler, value, out, out_of_range); 4685 LoadInt32FromMint(compiler, value, out, out_of_range);
4686 } else { 4686 } else {
4687 Label done; 4687 Label done;
4688 __ SmiUntag(out, value); 4688 __ SmiUntag(out, value);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
4948 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 4948 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
4949 #if defined(DEBUG) 4949 #if defined(DEBUG)
4950 __ LoadImmediate(S4, kInvalidObjectPointer); 4950 __ LoadImmediate(S4, kInvalidObjectPointer);
4951 __ LoadImmediate(S5, kInvalidObjectPointer); 4951 __ LoadImmediate(S5, kInvalidObjectPointer);
4952 #endif 4952 #endif
4953 } 4953 }
4954 4954
4955 } // namespace dart 4955 } // namespace dart
4956 4956
4957 #endif // defined TARGET_ARCH_MIPS 4957 #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