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

Side by Side Diff: runtime/vm/intermediate_language_arm64.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, 1 month 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_arm.cc ('k') | runtime/vm/intermediate_language_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after
3099 const intptr_t value_cid = value_type->ToCid(); 3099 const intptr_t value_cid = value_type->ToCid();
3100 const Register value = locs()->in(0).reg(); 3100 const Register value = locs()->in(0).reg();
3101 const VRegister result = locs()->out(0).fpu_reg(); 3101 const VRegister result = locs()->out(0).fpu_reg();
3102 3102
3103 if (value_cid == kDoubleCid) { 3103 if (value_cid == kDoubleCid) {
3104 __ LoadDFieldFromOffset(result, value, Double::value_offset(), PP); 3104 __ LoadDFieldFromOffset(result, value, Double::value_offset(), PP);
3105 } else if (value_cid == kSmiCid) { 3105 } else if (value_cid == kSmiCid) {
3106 __ SmiUntag(TMP, value); // Untag input before conversion. 3106 __ SmiUntag(TMP, value); // Untag input before conversion.
3107 __ scvtfdx(result, TMP); 3107 __ scvtfdx(result, TMP);
3108 } else { 3108 } else {
3109 Label* deopt = compiler->AddDeoptStub(deopt_id_, 3109 Label* deopt = compiler->AddDeoptStub(GetDeoptId(),
3110 ICData::kDeoptBinaryDoubleOp); 3110 ICData::kDeoptBinaryDoubleOp);
3111 if (value_type->is_nullable() && 3111 if (value_type->is_nullable() &&
3112 (value_type->ToNullableCid() == kDoubleCid)) { 3112 (value_type->ToNullableCid() == kDoubleCid)) {
3113 __ CompareObject(value, Object::null_object(), PP); 3113 __ CompareObject(value, Object::null_object(), PP);
3114 __ b(deopt, EQ); 3114 __ b(deopt, EQ);
3115 // It must be double now. 3115 // It must be double now.
3116 __ LoadDFieldFromOffset(result, value, Double::value_offset(), PP); 3116 __ LoadDFieldFromOffset(result, value, Double::value_offset(), PP);
3117 } else { 3117 } else {
3118 Label is_smi, done; 3118 Label is_smi, done;
3119 __ tsti(value, Immediate(kSmiTagMask)); 3119 __ tsti(value, Immediate(kSmiTagMask));
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3166 return summary; 3166 return summary;
3167 } 3167 }
3168 3168
3169 3169
3170 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3170 void UnboxFloat32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3171 const intptr_t value_cid = value()->Type()->ToCid(); 3171 const intptr_t value_cid = value()->Type()->ToCid();
3172 const Register value = locs()->in(0).reg(); 3172 const Register value = locs()->in(0).reg();
3173 const VRegister result = locs()->out(0).fpu_reg(); 3173 const VRegister result = locs()->out(0).fpu_reg();
3174 3174
3175 if (value_cid != kFloat32x4Cid) { 3175 if (value_cid != kFloat32x4Cid) {
3176 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); 3176 Label* deopt =
3177 compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
3177 __ tsti(value, Immediate(kSmiTagMask)); 3178 __ tsti(value, Immediate(kSmiTagMask));
3178 __ b(deopt, EQ); 3179 __ b(deopt, EQ);
3179 __ CompareClassId(value, kFloat32x4Cid, PP); 3180 __ CompareClassId(value, kFloat32x4Cid, PP);
3180 __ b(deopt, NE); 3181 __ b(deopt, NE);
3181 } 3182 }
3182 3183
3183 __ LoadQFieldFromOffset(result, value, Float32x4::value_offset(), PP); 3184 __ LoadQFieldFromOffset(result, value, Float32x4::value_offset(), PP);
3184 } 3185 }
3185 3186
3186 3187
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 return summary; 3220 return summary;
3220 } 3221 }
3221 3222
3222 3223
3223 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3224 void UnboxFloat64x2Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3224 const intptr_t value_cid = value()->Type()->ToCid(); 3225 const intptr_t value_cid = value()->Type()->ToCid();
3225 const Register value = locs()->in(0).reg(); 3226 const Register value = locs()->in(0).reg();
3226 const VRegister result = locs()->out(0).fpu_reg(); 3227 const VRegister result = locs()->out(0).fpu_reg();
3227 3228
3228 if (value_cid != kFloat64x2Cid) { 3229 if (value_cid != kFloat64x2Cid) {
3229 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); 3230 Label* deopt =
3231 compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
3230 __ tsti(value, Immediate(kSmiTagMask)); 3232 __ tsti(value, Immediate(kSmiTagMask));
3231 __ b(deopt, EQ); 3233 __ b(deopt, EQ);
3232 __ CompareClassId(value, kFloat64x2Cid, PP); 3234 __ CompareClassId(value, kFloat64x2Cid, PP);
3233 __ b(deopt, NE); 3235 __ b(deopt, NE);
3234 } 3236 }
3235 3237
3236 __ LoadQFieldFromOffset(result, value, Float64x2::value_offset(), PP); 3238 __ LoadQFieldFromOffset(result, value, Float64x2::value_offset(), PP);
3237 } 3239 }
3238 3240
3239 3241
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3271 return summary; 3273 return summary;
3272 } 3274 }
3273 3275
3274 3276
3275 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) { 3277 void UnboxInt32x4Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
3276 const intptr_t value_cid = value()->Type()->ToCid(); 3278 const intptr_t value_cid = value()->Type()->ToCid();
3277 const Register value = locs()->in(0).reg(); 3279 const Register value = locs()->in(0).reg();
3278 const VRegister result = locs()->out(0).fpu_reg(); 3280 const VRegister result = locs()->out(0).fpu_reg();
3279 3281
3280 if (value_cid != kInt32x4Cid) { 3282 if (value_cid != kInt32x4Cid) {
3281 Label* deopt = compiler->AddDeoptStub(deopt_id_, ICData::kDeoptCheckClass); 3283 Label* deopt =
3284 compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptCheckClass);
3282 __ tsti(value, Immediate(kSmiTagMask)); 3285 __ tsti(value, Immediate(kSmiTagMask));
3283 __ b(deopt, EQ); 3286 __ b(deopt, EQ);
3284 __ CompareClassId(value, kInt32x4Cid, PP); 3287 __ CompareClassId(value, kInt32x4Cid, PP);
3285 __ b(deopt, NE); 3288 __ b(deopt, NE);
3286 } 3289 }
3287 3290
3288 __ LoadQFieldFromOffset(result, value, Int32x4::value_offset(), PP); 3291 __ LoadQFieldFromOffset(result, value, Int32x4::value_offset(), PP);
3289 } 3292 }
3290 3293
3291 3294
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after
5280 summary->set_out(0, Location::RequiresRegister()); 5283 summary->set_out(0, Location::RequiresRegister());
5281 return summary; 5284 return summary;
5282 } 5285 }
5283 5286
5284 5287
5285 void UnboxIntNInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 5288 void UnboxIntNInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
5286 const intptr_t value_cid = value()->Type()->ToCid(); 5289 const intptr_t value_cid = value()->Type()->ToCid();
5287 const Register out = locs()->out(0).reg(); 5290 const Register out = locs()->out(0).reg();
5288 const Register value = locs()->in(0).reg(); 5291 const Register value = locs()->in(0).reg();
5289 Label* deopt = CanDeoptimize() ? 5292 Label* deopt = CanDeoptimize() ?
5290 compiler->AddDeoptStub(deopt_id_, ICData::kDeoptUnboxInteger) : NULL; 5293 compiler->AddDeoptStub(GetDeoptId(), ICData::kDeoptUnboxInteger) : NULL;
5291 5294
5292 if (value_cid == kSmiCid) { 5295 if (value_cid == kSmiCid) {
5293 __ SmiUntag(out, value); 5296 __ SmiUntag(out, value);
5294 } else if (value_cid == kMintCid) { 5297 } else if (value_cid == kMintCid) {
5295 __ LoadFieldFromOffset(out, value, Mint::value_offset(), PP); 5298 __ LoadFieldFromOffset(out, value, Mint::value_offset(), PP);
5296 } else { 5299 } else {
5297 Label done; 5300 Label done;
5298 __ SmiUntag(out, value); 5301 __ SmiUntag(out, value);
5299 __ TestImmediate(value, kSmiTagMask, PP); 5302 __ TestImmediate(value, kSmiTagMask, PP);
5300 __ b(&done, EQ); 5303 __ b(&done, EQ);
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
5606 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); 5609 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs());
5607 #if defined(DEBUG) 5610 #if defined(DEBUG)
5608 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP); 5611 __ LoadImmediate(R4, kInvalidObjectPointer, kNoPP);
5609 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP); 5612 __ LoadImmediate(R5, kInvalidObjectPointer, kNoPP);
5610 #endif 5613 #endif
5611 } 5614 }
5612 5615
5613 } // namespace dart 5616 } // namespace dart
5614 5617
5615 #endif // defined TARGET_ARCH_ARM64 5618 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698