| OLD | NEW |
| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 }; | 2469 }; |
| 2470 | 2470 |
| 2471 | 2471 |
| 2472 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2472 void BoxDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2473 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); | 2473 BoxDoubleSlowPath* slow_path = new BoxDoubleSlowPath(this); |
| 2474 compiler->AddSlowPathCode(slow_path); | 2474 compiler->AddSlowPathCode(slow_path); |
| 2475 | 2475 |
| 2476 Register out_reg = locs()->out().reg(); | 2476 Register out_reg = locs()->out().reg(); |
| 2477 XmmRegister value = locs()->in(0).fpu_reg(); | 2477 XmmRegister value = locs()->in(0).fpu_reg(); |
| 2478 | 2478 |
| 2479 AssemblerMacros::TryAllocate(compiler->assembler(), | 2479 __ TryAllocate(compiler->double_class(), |
| 2480 compiler->double_class(), | 2480 slow_path->entry_label(), |
| 2481 slow_path->entry_label(), | 2481 Assembler::kFarJump, |
| 2482 Assembler::kFarJump, | 2482 out_reg); |
| 2483 out_reg); | |
| 2484 __ Bind(slow_path->exit_label()); | 2483 __ Bind(slow_path->exit_label()); |
| 2485 __ movsd(FieldAddress(out_reg, Double::value_offset()), value); | 2484 __ movsd(FieldAddress(out_reg, Double::value_offset()), value); |
| 2486 } | 2485 } |
| 2487 | 2486 |
| 2488 | 2487 |
| 2489 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { | 2488 LocationSummary* UnboxDoubleInstr::MakeLocationSummary() const { |
| 2490 const intptr_t kNumInputs = 1; | 2489 const intptr_t kNumInputs = 1; |
| 2491 const intptr_t value_cid = value()->Type()->ToCid(); | 2490 const intptr_t value_cid = value()->Type()->ToCid(); |
| 2492 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); | 2491 const bool needs_temp = ((value_cid != kSmiCid) && (value_cid != kDoubleCid)); |
| 2493 const bool needs_writable_input = (value_cid == kSmiCid); | 2492 const bool needs_writable_input = (value_cid == kSmiCid); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3061 __ sbbl(EDX, Immediate(0)); | 3060 __ sbbl(EDX, Immediate(0)); |
| 3062 __ j(ABOVE_EQUAL, ¬_smi); | 3061 __ j(ABOVE_EQUAL, ¬_smi); |
| 3063 // 3. Restore lower half if result is a smi. | 3062 // 3. Restore lower half if result is a smi. |
| 3064 __ subl(EAX, Immediate(0x40000000)); | 3063 __ subl(EAX, Immediate(0x40000000)); |
| 3065 | 3064 |
| 3066 __ SmiTag(EAX); | 3065 __ SmiTag(EAX); |
| 3067 __ movl(out_reg, EAX); | 3066 __ movl(out_reg, EAX); |
| 3068 __ jmp(&done); | 3067 __ jmp(&done); |
| 3069 | 3068 |
| 3070 __ Bind(¬_smi); | 3069 __ Bind(¬_smi); |
| 3071 AssemblerMacros::TryAllocate( | 3070 __ TryAllocate( |
| 3072 compiler->assembler(), | |
| 3073 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()), | 3071 Class::ZoneHandle(Isolate::Current()->object_store()->mint_class()), |
| 3074 slow_path->entry_label(), | 3072 slow_path->entry_label(), |
| 3075 Assembler::kFarJump, | 3073 Assembler::kFarJump, |
| 3076 out_reg); | 3074 out_reg); |
| 3077 __ Bind(slow_path->exit_label()); | 3075 __ Bind(slow_path->exit_label()); |
| 3078 __ movsd(FieldAddress(out_reg, Mint::value_offset()), value); | 3076 __ movsd(FieldAddress(out_reg, Mint::value_offset()), value); |
| 3079 __ Bind(&done); | 3077 __ Bind(&done); |
| 3080 } | 3078 } |
| 3081 | 3079 |
| 3082 | 3080 |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3557 PcDescriptors::kOther, | 3555 PcDescriptors::kOther, |
| 3558 locs()); | 3556 locs()); |
| 3559 __ Drop(2); // Discard type arguments and receiver. | 3557 __ Drop(2); // Discard type arguments and receiver. |
| 3560 } | 3558 } |
| 3561 | 3559 |
| 3562 } // namespace dart | 3560 } // namespace dart |
| 3563 | 3561 |
| 3564 #undef __ | 3562 #undef __ |
| 3565 | 3563 |
| 3566 #endif // defined TARGET_ARCH_IA32 | 3564 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |