| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 __ cmpl(temp_reg, Immediate(class_ids[i])); | 978 __ cmpl(temp_reg, Immediate(class_ids[i])); |
| 979 if (i == class_ids.length() - 1) { | 979 if (i == class_ids.length() - 1) { |
| 980 __ j(NOT_EQUAL, deopt); | 980 __ j(NOT_EQUAL, deopt); |
| 981 } else { | 981 } else { |
| 982 __ j(EQUAL, &is_ok, Assembler::kNearJump); | 982 __ j(EQUAL, &is_ok, Assembler::kNearJump); |
| 983 } | 983 } |
| 984 } | 984 } |
| 985 __ Bind(&is_ok); | 985 __ Bind(&is_ok); |
| 986 } | 986 } |
| 987 | 987 |
| 988 |
| 989 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, |
| 990 Register reg, |
| 991 Register temp, |
| 992 Label* not_double_or_smi) { |
| 993 Label is_smi, done; |
| 994 __ testl(reg, Immediate(kSmiTagMask)); |
| 995 __ j(ZERO, &is_smi); |
| 996 __ LoadClassId(temp, reg); |
| 997 __ cmpl(temp, Immediate(kDouble)); |
| 998 __ j(NOT_EQUAL, not_double_or_smi); |
| 999 __ movsd(result, FieldAddress(reg, Double::value_offset())); |
| 1000 __ jmp(&done); |
| 1001 __ Bind(&is_smi); |
| 1002 __ movl(temp, reg); |
| 1003 __ SmiUntag(temp); |
| 1004 __ cvtsi2sd(result, temp); |
| 1005 __ Bind(&done); |
| 1006 } |
| 1007 |
| 1008 |
| 988 #undef __ | 1009 #undef __ |
| 989 | 1010 |
| 990 } // namespace dart | 1011 } // namespace dart |
| 991 | 1012 |
| 992 #endif // defined TARGET_ARCH_IA32 | 1013 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |