| 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) ? | 976 bool use_near_jump = class_ids.length() < 5; |
| 977 Assembler::kNearJump : Assembler::kFarJump; | |
| 978 __ LoadClassId(temp_reg, instance_reg); | 977 __ LoadClassId(temp_reg, instance_reg); |
| 979 for (intptr_t i = 0; i < class_ids.length(); i++) { | 978 for (intptr_t i = 0; i < class_ids.length(); i++) { |
| 980 __ cmpl(temp_reg, Immediate(class_ids[i])); | 979 __ cmpl(temp_reg, Immediate(class_ids[i])); |
| 981 if (i == class_ids.length() - 1) { | 980 if (i == class_ids.length() - 1) { |
| 982 __ j(NOT_EQUAL, deopt); | 981 __ j(NOT_EQUAL, deopt); |
| 983 } else { | 982 } else { |
| 984 __ j(EQUAL, &is_ok, jump_style); | 983 if (use_near_jump) { |
| 984 __ j(EQUAL, &is_ok, Assembler::kNearJump); |
| 985 } else { |
| 986 __ j(EQUAL, &is_ok); |
| 987 } |
| 985 } | 988 } |
| 986 } | 989 } |
| 987 __ Bind(&is_ok); | 990 __ Bind(&is_ok); |
| 988 } | 991 } |
| 989 | 992 |
| 990 | 993 |
| 991 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, | 994 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, |
| 992 Register reg, | 995 Register reg, |
| 993 Register temp, | 996 Register temp, |
| 994 Label* not_double_or_smi) { | 997 Label* not_double_or_smi) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1006 __ cvtsi2sd(result, temp); | 1009 __ cvtsi2sd(result, temp); |
| 1007 __ Bind(&done); | 1010 __ Bind(&done); |
| 1008 } | 1011 } |
| 1009 | 1012 |
| 1010 | 1013 |
| 1011 #undef __ | 1014 #undef __ |
| 1012 | 1015 |
| 1013 } // namespace dart | 1016 } // namespace dart |
| 1014 | 1017 |
| 1015 #endif // defined TARGET_ARCH_IA32 | 1018 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |