| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 void FlowGraphCompiler::EmitClassChecksNoSmi( | 966 void FlowGraphCompiler::EmitClassChecksNoSmi( |
| 967 const ZoneGrowableArray<intptr_t>& class_ids, | 967 const ZoneGrowableArray<intptr_t>& class_ids, |
| 968 Register instance_reg, | 968 Register instance_reg, |
| 969 Register temp_reg, | 969 Register temp_reg, |
| 970 Label* deopt) { | 970 Label* deopt) { |
| 971 Label ok; | 971 Label ok; |
| 972 ASSERT(class_ids[0] != kSmi); | 972 ASSERT(class_ids[0] != kSmi); |
| 973 __ testl(instance_reg, Immediate(kSmiTagMask)); | 973 __ testl(instance_reg, Immediate(kSmiTagMask)); |
| 974 __ j(ZERO, deopt); | 974 __ j(ZERO, deopt); |
| 975 Label is_ok; | 975 Label is_ok; |
| 976 bool jump_style = (class_ids.length() < 5) ? |
| 977 Assembler::kNearJump : Assembler::kFarJump; |
| 976 __ LoadClassId(temp_reg, instance_reg); | 978 __ LoadClassId(temp_reg, instance_reg); |
| 977 for (intptr_t i = 0; i < class_ids.length(); i++) { | 979 for (intptr_t i = 0; i < class_ids.length(); i++) { |
| 978 __ cmpl(temp_reg, Immediate(class_ids[i])); | 980 __ cmpl(temp_reg, Immediate(class_ids[i])); |
| 979 if (i == class_ids.length() - 1) { | 981 if (i == class_ids.length() - 1) { |
| 980 __ j(NOT_EQUAL, deopt); | 982 __ j(NOT_EQUAL, deopt); |
| 981 } else { | 983 } else { |
| 982 __ j(EQUAL, &is_ok, Assembler::kNearJump); | 984 __ j(EQUAL, &is_ok, jump_style); |
| 983 } | 985 } |
| 984 } | 986 } |
| 985 __ Bind(&is_ok); | 987 __ Bind(&is_ok); |
| 986 } | 988 } |
| 987 | 989 |
| 988 | 990 |
| 989 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, | 991 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, |
| 990 Register reg, | 992 Register reg, |
| 991 Register temp, | 993 Register temp, |
| 992 Label* not_double_or_smi) { | 994 Label* not_double_or_smi) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1004 __ cvtsi2sd(result, temp); | 1006 __ cvtsi2sd(result, temp); |
| 1005 __ Bind(&done); | 1007 __ Bind(&done); |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 | 1010 |
| 1009 #undef __ | 1011 #undef __ |
| 1010 | 1012 |
| 1011 } // namespace dart | 1013 } // namespace dart |
| 1012 | 1014 |
| 1013 #endif // defined TARGET_ARCH_IA32 | 1015 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |